Step 1 : Adding the Dotdeb repository
You can skip this step if you have already added the Dotdeb repository while installing NGINX and PHP-FPM on your Debian Squeeze Server. We need to grab the latest version of MySQL to benefit from all new updates and bug fixes. Read this article for information on adding the Dotdeb repository to your Rackspace Cloud Server.
Step 2 : Install the MySQL server and client
Installation is simple. Just use the following command.
[shell]apt-get install mysql-server mysql-client[/shell]
You will be prompted to key in the MySQL ‘root’ password during the installation. Make sure the password is hard to crack. Once the install is over, you can run
to remove the ‘test’ database and test users. MySQL should be up and running by now!
Step 3 : Configuring and optimising the MySQL Server
MySQL can get resource hungry. There are many articles around the web that talk about MySQL optimisation. The few settings that I have shown here will help free up some memory (RAM). Edit the following MySQL configuration file.
The settings that are already in the MySQL configuration file are pretty decent. You can add just the following to free up some additional memory.
key_buffer = 8M
You can use the Perl script found at https://github.com/rackerhacker/MySQLTuner-perl to further optimise the database server.
Step 4 : Creating a new database user and database
We will need to create a new database and user for the WordPress installation. The following command should do that.
[shell]mysql -h localhost -u root -pPassword[/shell]
GRANT USAGE ON *.* TO ‘newuser’@’localhost’ IDENTIFIED BY ‘password’
GRANT ALL PRIVILEGES ON `newdbname`.* TO ‘newuser’@’localhost’
This command will create a newuser with a password and assign the user to the new database with the name newdbname.
Step 5 : Restart the MySQL server
[shell]service mysql restart[/shell]
That’s it! You now have a working MySQL database server.