Install MySQL on a Linux Machine
Issue
You need to install MySQL on a computer running Linux.
Solution
Step 1: Refresh package dDatabase.
MySQL database server is now owned by Oracle (formally Sun Microsystems) but can be installed using command line options without compiling anything under Ubuntu Linux. Open a terminal, then copy and paste the following commands to upgrade package database:
sudo apt-get update
sudo apt-get upgrade
Step 2: Install MySQL.
2A. Copy the following command into your Terminal:
sudo apt-get install mysql-server mysql-common mysql-client
2B. You'll be prompted to enter a New password for the MySQL "root" user. Enter a password. We recommend using the password landfx.
2C. You'll then be prompted to repeat your password. Enter your password again.
Step 3: Configure MySQL.
3A. Type the following command:
mysql -u root -p
3B. You'll be prompted to supply the root user account password. Enter the password you created in Step 2 above (example: landfx).
3C. Once logged in, you'll see the following text:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 107
Server version: 5.1.41-3ubuntu12.3 (Ubuntu)
3D. Type 'help;'
or '\h'
.
Then type '\c'
to clear the current input statement.
Step 4: Create the MySQL database.
4A.Copy and paste the following command:
create database landfx;
You should now see:
Query OK, 1 row affected (0.00 sec)
4B. Copy and paste the following command:
create user 'ODBC';
You should now see:
Query OK, 0 rows affected (0.00)
4C. Copy and paste the following command to grant permissions to the landfx database for user ODBC:
grant all on landfx.* to 'ODBC';
You should now see:
Query OK, 0 rows affected (0.00)
4D. Copy and paste the following command to grant permissions for localhost. (This step is necessary for dual NIC computers or laptops.):
grant all on landfx.* to ''@'localhost';
You should now see:
Query OK, 0 rows affected (0.00)
Step 5: Restore database (if necessary).
Note: This step is only necessary after the migration of an installation.
5A. Follow our steps to move data from old Land F/X server to a new computer. This step will create a file named backup.sql.
5B. Save the& backup.sql& file (created in the previous step) to the user's computer. We recommend saving it to the user's desktop for easy access. This step will create a file a file named landfxdump.sql.
5C. Make note of path to the file& landfxdump.sql. If you've saved the file to the desktop, the path will be /home/user/Desktop/landfxdump.sql.
5D. If you're still in your MySQL console, type quit;
5E. Copy and paste the following command in the From the default terminal windowe:
mysql -u root -p database < /path/to/backup-file.sql
&
Replace database with the name of the database you created.
For example:
mysql -u root -p landfx < /home/user/Desktop/landfxdump.sql
Step 6: Verify database restore.
To verify that the restore worked, you'll need to check the tables.
6A. Log in to the MySQL CLC by typing:
mysql -u root -p
6B. When prompted, enter your password: (example: landfx).
6C. Switch to the landfx database by typing use landfx;
You should now see:
Database changed
6D. To display the table, type show tables;
6E. You should see the list of tables:
+------------------+\\
| Tables_in_landfx |\\
+------------------+\\
| project_data |\\
| projects |\\
+------------------+\\
2 rows in set (0.01 sec)
If you see these tables, you've completed the necessary steps.
Troubleshooting
Unbind 127.0.0.1
If you're unable to connect to the server from other computers, you'll need to comment out the bind-address in the my.cnf file. This step will allow other machines on the network to access the MySQL Server.
1. Open the my.cnf file using your favorite editor:
/etc/mysql/my.cnf
2. Find line:
bind-address = 127.0.0.1
3. Comment it out to look like the following line:
#bind-address = 127.0.0.1
Disable DNS Hostname Lookup
Some MySQL servers are slow to respond because they're performing an excessive number of name resolution queries. If this is the case, you can disable hostname resolution on the server by completing the following steps:
1. Open the my.cnf file using your favorite editor:
/etc/mysql/my.cnf
2. Add the "skip-name-resolve" Under [mysqld]:
''[mysqld]
..
..
skip-name-resolve''
Restart the MySQL Service for these changes to take effect.