Install MySQL
Download mysql-standard-4.1.8-pc-linux-i686.tar.gz file to directory/usr/local/
# Groupadd MySQL//add MySQL user group
# useradd-g MySQL mysql//in MySQL user to MySQL user group
# TAR–ZXVF mysql-standard-4.1.8-pc-linux-i686.tar.gz//Unzip the installation package
# rm–f mysql-standard-4.1.8-pc-linux-i686.tar.gz//Delete compressed package
# mv mysql-standard-4.1.8-pc-linux-i686 MySQL//Put files in mysql-standard-4.1.8-pc-linux-i686 into MySQL text Folders, and delete the mysql-standard-4.1.8-pc-linux-i686 folder
# CD MySQL//go to MySQL folder
# CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF//Copy the configuration file to/etc/under Rename to My.cnf, at this time Prompt to overwrite duplicate file, answer Y
# scripts/mysql_install_db--user=mysql//with MySQL user initialized database, must be with MySQL user
# Chown-r Root. Note that the following is a bit, which indicates that the owner of all files and subdirectories under the current directory is set to the root user
# chown-r MySQL Data//indicates that the owner of the data directory under the current directory is set as a MySQL user
# chgrp-r MySQL. Note that the following is a bit, which indicates that the file group for the file under the current directory is set to the MySQL group
# Bin/mysqld_safe--user=root &//& Show background start
At this point, if "... ended" is not displayed, the boot succeeds. Enter to display the command input line.
To see if MySQL starts:
# Ps-aux | grep mysqld
You will see information similar to the following:
Root 14105 0.0 0.0 3896 660 pts/0 s+ 08:50 0:00 grep mysqld
Root 14304 0.0 0.0 4452 1092? S Apr24 0:00/bin/sh./mysqld_safe--user=mysql
MySQL 14327 0.0 0.7 41024 14508? S Apr24 0:01/usr/local/mysql/bin/mysqld--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=mysql--pi D-file=/usr/local/mysql/data/localhost.localdomain.pid--skip-locking--port=3306--socket=/tmp/mysql.sock
MySQL 14328 0.0 0.7 41024 14508? S Apr24 0:01/usr/local/mysql/bin/mysqld--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=mysql--pi D-file=/usr/local/mysql/data/localhost.localdomain.pid--skip-locking--port=3306--socket=/tmp/mysql.sock
MySQL 14329 0.0 0.7 41024 14508? S Apr24 0:00/usr/local/mysql/bin/mysqld--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=mysql--pi D-file=/usr/local/mysql/data/localhost.localdomain.pid--skip-locking--port=3306--socket=/tmp/mysql.sock
To see if MySQL is listening on the port:
# Netstat-tl | grep MySQL
You'll see something like this:
TCP 0 0 *:mysql *:* LISTEN
Errors that may occur:
Can ' t connect to local MYSQL server through socket '/tmp/mysql.sock ' at this time ensure that the "socket" profile in/ETC/MY.CNF is present
such as:/etc/my.cnf in Socket=/tmp/mysql.sock in/tmp/must have Mysql.sock file if not then # Touch/tmp/mysql.sock//build Mysql.sock file
Can ' t create/write to file '/usr/local/mysql/data/localhost.localdomain.pid ' has this kind of error occurred, View permissions issues and whether localhost.localdomain.pid files exist
Set permissions command: # chown–r Create File command: # Touch
Can ' t create/write to file '/usr/local/mysql/data/localhost.localdomain.pid ' error may also occur when MySQL is started and no stop service is started again
Uninstall MySQL
# rpm-qa|grep-i MySQL
The following information may appear:
mysql-server-4.1.8-0
mysql-client-4.1.8-0
Occurs then executes:
# Rpm-ev mysql-server-4.1.8-0 mysql-client-4.1.8-0
Then manually delete the/usr/local/mysql folder and configuration files, etc.
# Rm–rf/usr/local/mysql
# rm-f/ETC/MY.CNF
Install MySQL notebook under Linux