PS: This article is reproduced from http://blog.csdn.net/lyjinger/article/details/1648845
Lyjinger software: MySQL Server installation and configuration
Note: I have some experiences in installing and configuring the MySQL server. MySQL 5.0.41, platform: linux-i386
1. MySQL installation steps:
1. decompress and install the SDK (source code package SRC installation and Binary Package bin installation)
In fact, the installation of MySQL is relatively simple. Just install it.
For the source code package, the steps are as follows:
Tar-zxvf mysql-5.0.41.tar.gz
./Configure -- prefix =/usr/local/MySQL/
-- With-extra-charsets = GBK/
-- With-charset = GBK
Make
Make install
For a Binary Package, perform the following steps:
CD/usr/local
Tar-zxvf mysql-5.0.41-linux-i686.tar.gz
Ln-s mysql-5.0.41-linux-i686 MySQL
2. Add database users and groups
Groupadd MySQL
Useradd-G MySQL
3. Install the database
CD/usr/local/MySQL
Ln-S/usr/local/MySQL/bin/MySQL/usr/local/bin/MySQL
CP support-files/my-medium.cnf/etc/My. CNF
Bin/mysql_install_db -- user = MySQL
Chown-r root.
SRC package execution:
Chown-r MySQL VaR
Bin package execution:
Chown-r Mysql Data
Chgrp-r MySQL.
4. test whether the installation is successful.
Bin/mysqld_safe -- user = MySQL &
Mysql-u root-P (Note: The initial password of the root user is blank. Press Enter Password: To press Enter .)
If you enter the MySQL prompt, the installation is successful. Otherwise, the installation fails. Check the preceding installation steps.
Ii. MySQL configuration (for your reference only ):
1. Configure MySQL self-starting service
CP support-files/MySQL. Server/etc/init. d
Ln-S/etc/init. d/MySQL. Server/etc/rc3.d/s99mysql
Ln-S/etc/init. d/MySQL. Server/etc/rc0.d/k01mysql
Reboot to test whether the self-starting service is successful
2. Database User, password, and access permission settings:
Mysql-u root-P
Use MySQL;
Delete Anonymous Users:
Delete from user where user = '';
Set the root user password:
Set password for 'root' @ '127. 0.0.1 '= PASSWORD (' [newpassword] ');
Set password for 'root' @ 'localhost' = PASSWORD ('[newpassword]');
Set password for 'root' @ 'hostname' = PASSWORD ('[newpassword]');
Flush privileges;
Set remote access:
Grant all privileges on *. * To 'root' @ '% 'identified by' [newpassword] 'with grant option;