Many modern Unix/Linux systems come with MySQL pre-installed. The following instructions are for LAS installers setting LAS up on a new machine where MySQL has not yet been configured. If you need to install MySQL, please see the MySQL Downloads page for instructions. Complete reference documentation is available at the MySQL Documentation page. Of course you should be following the instructions there. But they run into the hundreds of pages and cover installation on Windows systems and all sorts of other non-vanilla flavors of installation.
The following instructions for Unix/Linux systems are the simplest set of commands you can use to set up MySQL and are excerpted from the MySQL 3.23, 4.0, 4.1 pages on Unix Post-Installtion Procedures (1-7) and Securing the Initial MySQL Accounts (8-11).
- Become the superuser
> su root
- Make sure the mysql~ commands are in your path. (They might be in /usr/bin, /usr/local/bin, /usr/local/mysql/bin, ...)
> which mysql_install_db
/usr/bin/mysql_install_db - Set up the initial MySQL grant tables. (Don't worry, you won't overwrite any existing tables.)
> mysql_install_db --user=mysql
- Start the MySQL server. (Hit return again if you don't see your prompt.)
> mysqld_safe --user=mysql &
- Verify the server is running.
> mysqladmin version
...
> mysqladmin variables
... - Verify you can shut down the server.
> mysqladmin -u root shutdown
- Verify you can restart the server.
> mysqld_safe --user=mysql --log &
- Set passwords for the anonymous accounts. (Use appropriate values for host_name and newpwd.)
shell> mysql -u root
mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('newpwd
');
mysql> SET PASSWORD FOR ''@'host_name
' = PASSWORD('
newpwd
');
- Set passwords for the root accounts. (Use appropriate values for host_name and newpwd.)
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('
newpwd
');
mysql> SET PASSWORD FOR 'root'@'host_name
' = PASSWORD('
newpwd
');
mysql> quit; - Shutdown using the password.
> mysqld -u root -p shutdown
Enter password:
newpwd - Restart MySQL for the last time.
> mysqld_safe --user=mysql --log &
At this point your MySQL server should be running with some security and appropriate permissions for LAS to be installed. When you run the LAS configure script you will be prompted for the MySQL password. Use the newpd
you set at step 9.