InInstall MySql in Linux
Mysql-standard-4.0.24-pc-linux-gnu-i686.tar.gz this file
FromHttp://dev.mysql.com/downloads/index.htmldownload
Mysql-standard-4.0.24-pc-linux-gnu-i686.tar.gz is mysql4.0.24 version of the installation file, is a binary compressed package, so our Installation Method for Binary distribution installation.
Installation steps:
1.SetThe mysql-standard-4.0.24-pc-linux-gnu-i686.tar.gz copies to a directory
2.Shell> Tar zvxf Mysql-standard-4.0.24-pc-linux-gnu-i686.tar.gz
3.The above command will generateMysql-standard-4.0.24-pc-linux-gnu-i686 folder
4.Shell> mvMysql-standard-4.0.24-pc-linux-gnu-i686/usr/local/MySQL
5.The above command isAll the stuff under the mysql-standard-4.0.24-pc-linux-gnu-i686, cut to/usr/local/MySQL, this step is for later convenience.
6.Shell> groupadd MySQLAdd a user group named MySQL
7.Shell> useradd-G MySQLAdd a user named MySQL to the MySQL user group.
If the preceding two commands cannot be executed, switchRun
Shell> su root-
8.Shell> CD/Usr/local/MySQL
9.Shell>CP support-files/my-medium.cnf/etc/My. CNF
This will askWhether to overwrite the duplicate file. Answer:Y
10. Shell> scripts/mysql_install_db -- user = MySQL
ToMySQL userInitialize Database, Must startMySQL user
11.Shell> chown-r Root.
Note the following: Set the owner of all files and subdirectories in the current directory.
SetRoot User
12. Shell> chown-r Mysql Data
IndicatesThe owner of the data directory is set to a MySQL user.
13. Shell> chgrp-r MySQL.
Note that the file group in the current directory is setMySQL Group
14. Shell> bin/mysqld_safe -- user = root &
If not"…… Ended"That's all!
15.Press enter to displayShell>
Now you can
L shell> netstat-atln command view 3306 whether the port is enabled
L Alternatively, shell> PS-Ef | grep mysqld View mysqld Process
L or directly shell> bin/MySQL-u root to enter the mysql client, mySQL operation
LOrShell> bin/mysqladmin shutdown to stop MySQL services
Remember: YourThe root user does not have a password, and any identity can be entered using root. You can
PassShell> Bin /Mysqladmin-u Root Password 'new password' to set the password for the root user. This password is required when you enter the mysql client and stop the MySQL service.
Tip: when starting a single service, you can modify/Etc/My. CNF file to configure
AvailableHow to open my. CnF in the VI editor?,Pai_^
Shell> VI my. CNF open my. CNF
Find the following section
[Mysqld]
Port = 8888
Socket =/tmp/MySQL. Sock
You can add the corresponding configuration
Log =/var/log/MySQL. Log
Datadir =/free/mysqldbf
For exampleLog =/* change the log storage location
Datadir =/free/mysqldbf changes the data storage location
You wantA friend who has encountered the same problem is helpful.Pai_^