Document directory
- 1. Download the MySQL 5.5 Deb installation package
- 2. Install the Deb package
- 3. Enabling MySQL
1. Download the MySQL 5.5 Deb installation package
CD/usr/local/src
Sudo wget-O mysql-5.5.22-debian6.0-i686.deb http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.22-debian6.0-i686.deb/from/http://mysql.ntu.edu.tw/
2. Install the Deb package
Sudo dpkg-I mysql-5.5.22-debian6.0-i686.deb
The MySQL server is initialized at/opt/MySQL/Server-5.5.
3. Enabling MySQL
Groupadd MySQL
Useradd-r-g MySQL
Sudo apt-Get install libaio-Dev
Ln-S/opt/MySQL/Server-5.5/usr/local/MySQL
Sudo mkdir/usr/local/MySQL/Data
Sudo chown-r mysql./usr/local/MySQL/Data
Initialize Database
Sudo/usr/local/MySQL/scripts/mysql_install_db -- user = MySQL -- basedir =/usr/local/MySQL -- datadir =/usr/local/MySQL/Data
Put the startup shell program of mysqld in the system service directory.
Sudo CP/usr/local/MySQL/support-files/MySQL. Server/etc/init. d/MySQL
Put the MySQL configuration file in the/etc directory of the System Configuration. MySQL should use this configuration file in the global scope.
Sudo CP/usr/local/MySQL/support-files/my-medium.cnf/etc/My. CNF
Start MySQL
Sudo/etc/init. d/MySQL start
Change the MySQL root administrator password
Sudo/usr/local/MySQL/bin/mysqladmin-u Root Password [the password you want to set]
Test whether you can log on to MySQL
Sudo/usr/local/MySQL/bin/MySQL-u root-P [Optional database name]
MySQL. Sock is stored in/tmp/MySQL. Sock
Note: If you add mysql_server to the system service directory/etc/init. d/must ensure that the MySQL program directory is in/usr/local/MySQL. You can use soft links to direct to other installation directories.
If mysql-common is installed later, the configuration file of MySQL server will be affected. You need to change the/etc/MySQL/My. basedir, datadir, and log in CNF or modify PHP. settings in ini, such as PDO