Installation of MySQL:
1. Add User Group
#> Groupadd MySQL
2, add Users
#> useradd-r-G MySQL MySQL
3, switch to the installation directory (take/usr/local as an example)
#> cd/usr/local
4, Decompression (Mysql-5.5.22-linux2.6-i686.tar.gz has been copied to/usr/local)
#> Tar zxvf mysql-5.5.22-linux2.6-i686.tar.gz
5, rename the directory name
#> MV mysql-5.5.22-linux2.6-i686 MySQL
6, delete the compressed package (operable)
#> RM mysql-5.5.22-linux2.6-i686.tar.gz
7, into the MySQL directory
#> CD MySQL
8, change user rights and group permissions
#> chown-r MySQL.
#> chgrp-r MySQL.
9. Initializing the database
<1> Guarantee There is no my.cnf under the/etc/directory, if you please delete
<2> Initializing DB
#> Scripts/mysql_install_db–user=mysql
After the completion of the above, according to the prompts to see whether the success, did not succeed on their own reasons.
MySQL's configuration:
Configuring MySQL is primarily my.cnf files and startup files. These two files are available under the installation directory, and are copied to the specified directory.
#> CP support-files/my-default.cnf/etc/my.cnf
#> CP Support-files/mysql.server/etc/rc.d/init.d/mysql
In general, the my.cnf file must modify the configuration itself. A lot of profiles on the web, do not introduce.
Set a password for the root user of MySQL:
#>./bin/mysqladmin-u root password ' 123456′
The Mysql.server file will not need to be modified. However, you may need to modify your installation directory if it is not/usr/local and you may want to modify the Basedir in this file to your installation directory.
The aftermath of MySQL:
After completing the above configuration, you should be able to service MySQL start in the terminal to start the MySQL services, you can use the Netstat-ant command to see the MySQL default 3306 port is not open.
However, the MySQL command is not recognized in the terminal. You need to add the/usr/local/mysql/bin directory to the environment variable path or make a soft connection to the/usr/bin below.
Ln-s/usr/local/mysql/bin/mysql/usr/bin/mysql