Download the mysql-5.5.19-linux2.6-i686.tar.gz package from the official network. Decompress this package and use it as a compiled file. You can directly modify the configuration without compiling or installing it yourself. Objective-C
Download the mysql-5.5.19-linux2.6-i686.tar.gz package from the official network. Decompress this package and use it as a compiled file. You can directly modify the configuration without compiling or installing it yourself. 1. Copy the mysql-5.5.19-linux2.6-x86_64.tar.gz to the/opt directory 2. Unzip # tar -zxvfmysql-5.5.19-linux2.6-i686.tar.gz-C
Download the mysql-5.5.19-linux2.6-i686.tar.gz package from the official network. Decompress this package and use it as a compiled file. You can directly modify the configuration without compiling or installing it yourself.
1. SetCopy mysql-5.5.19-linux2.6-x86_64.tar.gz/OptDirectory
2. Decompress
# Tar -zxvfmysql-5.5.19-linux2.6-i686.tar.gz-C/usr/local /;
Note: It is very important to decompress the package to/usr/local /.
3. SetMysql-5.5.19-linux2.6-x86_64 Change the folder name to mysql
Note: The current mysql directory is/usr/local/mysql (if it is in another directory, there will be many Installation Problems)
4. Create Database User Groups and users
# Groupaddmysql
# Useradd-gmysql mysql
5. Copy the mysql STARTUP script mysql. server to the/etc/rc. d/init. d directory and name it mysql;
# Cpsupport-files/mysql. server/etc/rc. d/init. d/mysql
7. Copy the mysql configuration fileMy-medium.cnf to the/etc/directory, named my. cnf;
# Cpsupport-files/my-medium.cnf/etc/my. cnf
8. Modify the mysql directory permission;
# Chown-Rroot/Usr/local/mysql // Change the user of the mysql directory
# Chgrp-Rmysql/usr/local/mysql // Change the group to which the mysql directory belongs
# Chown-Rmysql/usr/local/mysql/data // Change the user to which the data directory belongs. This directory is used to store databases.
9. Generate a mysql System Database. Run/usr/local/mysql/scripts/mysql_install_db to install the authorization table.
#/Usr/local/mysql/scripts/mysql_install_db -- user = mysql &
10,Start the mysql service.Run/usr/local/mysql/bin/mysqld_safe
#/Usr/local/mysql/bin/mysqld_safe -- user = mysql &
If Starting mysqld daemon withdatabase from/usr/local/mysql/data is displayed, the mysql server is started normally.
11. Start the mysql Service
#/Etc/rc. d/init. d/mysql start
12. Start mysql
#/Usr/local/mysql/bin/mysql
Mysql>
At this point, mysql is done. You can operate the database and change the administrator password ......
Notes for starting mysql:
(1) To start mysql, you must first start the mysql_safe service (step 1 above ).
#/Usr/local/mysql/bin/mysqld_safe -- user = mysql &
(2) Start the mysql service (step 1 above))
#/Etc/rc. d/init. d/mysql start
(3) Start mysql
#/Usr/local/mysql/bin/mysql
Ii. logon to mysql:
(1) If you are already in the/usr/local/mysql/bin directory
Run: #./mysql
If the root user sets a password
Run:
./Mysql-u root-p
Enter the mysql root Password and press Enter.
(2) If you are in another directory
Run: #/usr/local/mysql/bin/mysql
If the root user sets a password
Run:
/Usr/local/mysql/bin/mysql-u root-p
Enter the mysql root Password and press Enter.
Iii. Enable mysql to start automatically in Linux
In the decompress package/usr/local/MySQL/support-files of the mysql installer, there is a STARTUP script program named myslq. server. Copy it to the/etc/rc. d/init. d directory:
# Cd/etc/rc. d/init. d
# Cp/usr/local/mysql/support-files/mysql. server mysql
Change its attribute to "x" (executable, executable)
# Chmod + x mysql
Finally, run chkconfig to add MySQL to the startup Service Group of your system.
Run chkconfig -- add mysql
4. Modify the root user password:
/Usr/local/mysql/bin/mysqladmin-u root password 'new-password'
/Usr/local/mysql/bin/mysqladmin-u root-h test11 password 'new-password'