Install mysql5.5.19 in Linux [verified]

Source: Internet
Author: User

From http://www.myhack58.com/Article/sort099/sort0102/2011/30199.htm

The test is installed successfully, and the following errors are modified (The modified version in bold is 5.5.19.):

 

1. Install the required system library files
Yum-y install GCC gcc-C ++ gcc-g77 Autoconf automake zlib * fiex * libxml *
Ncurses-devel libmcrypt * libtool-ltdl-devel *

[Note: this step is not performed because the machine has GCC installed.]

2. Create the MySQL installation directory
# Mkdir-P/usr/local/webserver/MySQL/

3. Create a data storage directory
# Mkdir-P/data/MySQL/

4. Create users and user groups and grant data storage directory permissions
# Groupadd MySQL
# Useradd-G MySQL
# Chown mysql. mysql-r/data/MySQL/

5. Install cmake (after mysql5.5 is compiled using cmake)
# Wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz
# Tar zxvf cmake-2.8.4.tar.gz
# Cd cmake-2.8.4
#. Configure
# Make & make install

6. Download and decompress MySQL 5.5.11
Wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.19.tar.gz
[Root @ localhost down] # tar zxvf mysql-5.5.19.tar.gz
[Root @ localhost down] # cd mysql-5.5.19

7, compile mysql-5.5.19
Cmake .\
-Dcmake_install_prefix =/usr/local/webserver/MySQL /\
-Dmysql_datadir =/data/MySQL \
-Dmysql_unix_addr =/data/MySQL/mysqld. Sock \
-Dwith_innobase_storage_engine = 1 \
-Denabled_local_infile = 1 \
-Dmysql_tcp_port = 3306 \
-Dextra_charsets = all \-ddefault_charset = utf8 \
-Ddefault_collation = utf8_general_ci \
-Dmysql_unix_addr =/data/MySQL. Sock \
-Dmysql_user = MySQL \
-Dwith_debug = 0

[Warning: the variable, 'mysql user', specified manually, was not used during the generation., can be ignored]

 

[Root @ host mysql-5.5.11] # Make
[Root @ host mysql-5.5.11] # make install

8. Copy the configuration file.
[Root@mysql-5.5.11] # cp support-files/my-medium.cnf/etc/My. CNF
[Root@mysql-5.5.11] # cp support-files/MySQL. Server/etc/init. d/mysqld
[Root@mysql-5.5.11] # chmod 755/etc/init. d/mysqld

9. initialize the database
Bash scripts/mysql_install_db -- user = MySQL -- basedir =/usr/local/webserver/MySQL -- datadir =/data/MySQL/

10. Start the MySQL service.
[Root @ localhost mysql-5.5.11] #/etc/init. d/mysqld start
11. Run the PS-Ef | grep MySQL command to check whether the instance is started.
12,/usr/local/webserver/MySQL/bin/MySQL-u root-P
The initial password for logging on to the MySQL server through the command line is blank.

13. Change the root password
Mysql> use MySQL;
Mysql> Update user SET Password = PASSWORD ("123456") where user = 'root ';
Mysql> flush privileges;

 

 

Problems:

1. **** is not allowed to connect to this MySQL Server

Solution:

Run the following command on the machine where MySQL is installed:

1. D: \ mysql \ bin \> mysql-H localhost-u root // enter the MySQL server.

2. mysql> grant all privileges on *. * To 'root' @ '%' with grant option // grant data access permissions to any host

3. mysql> flush privileges // The modification takes effect.

4. mysql> exit // exit the MySQL server

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.