I use binaryto install it. the file name is mysql-standard-5.0.18-linux-i686-glibc23.tar.gz [1]. decompress the above file to a certain place and change the directory name of MySQL to mysql, the result should be as follows: homejiangmysql [2] install SQL Servermysql based on the INSTALL-BINARY file in the mysql Directory
I use binary for installation, file name
Mysql-standard-5.0.18-linux-i686-glibc23.tar.gz
[1] decompress the above file to a certain place and change the directory name of MySQL to mysql. The result should be as follows:
/Home/jiang/mysql
[2] INSTALL based on the INSTALL-BINARY file in the mysql Directory
// Add the user group mysql and the user mysql. you do not need to modify this command.
Shell> groupadd mysql
Shell> useradd-g mysql
// The main purpose of the following three steps is to extract a link to the MySQL directory and put itUsr/localDirectory
// First, enter the/usr/local directory; The Command does not need to be modified
Shell> cd/usr/local
// This step is not required because it has been decompressed.
Shell> gunzip </PATH/TO/MYSQL-VERSION-OS.tar.gz | tar xvf-
// Make/Home/jiang/mysqlIn/usr/local. The Connection name is mysql.
// This command is modifiedLn-s/home/jiang/mysql
Shell> ln-s FULL-PATH-TO-MYSQL-VERSION-OS mysql
// Enter the/home/jiang/mysql directory, and/usr/local/mysql is /Home/jiang/mysql connection
Shell> cd mysql
// Initialize MySQL (this step can be simplified if MySQL has been installed before ); The Command does not need to be modified
Shell> scripts/mysql_install_db -- user = mysql
// Change ownership; The Command does not need to be modified
Shell> chown-R root.
Shell> chown-R mysql data
Shell> chgrp-R mysql.
// Start the MySQL server; The The command does not need to be modified
Shell> bin/mysqld_safe -- user = mysql &
[3] Entering the MySQL application environment
Go to the bin directory under the mysql directory and run the command./Mysql-u root-p,In this casePassword: (enter the password)But by default, the root user does not have a password, so press Enter. In this case, the MySQL interface is displayed. of course, it is still a command line window.
[4] simple use of MySQL
Run commands in the MySQL environmentShow databases;, The existing database (such as test) will be displayed; run the commandUse testWill enter the test database...
Note: If you are running./Mysql-u root-pThen, report
Can't connect to local MySQL server through socket '/tem/mysql. sock'
The following situations may occur:
[1] mysql. sock is not in the/tmp directory, but in another directory (for example,/var/lib/mysql directory ). In this case, you only need to link this mysql. sock to the/tmp directory and run the following command:
Ln-s MYSQL. SOCK_PATH/tmp/mysql. sock
[2] mysql. sock is generated under/tmp in a classmate's notebook Linux, but the file is deleted after Linux is restarted. You can also use the solution in case 2, or run the following command every time:
./Mysqld_safe -- user = mysql &