The entire process of installing MySql in centos

Source: Internet
Author: User
Tags localhost mysql centos server
The entire process of installing MySql in centos

1. Download MySQL from chinaunix

: Http://download.chinaunix.net/download/0008000/7159.shtml

2. upload to the centos Server

This example is stored in/home/jiangfeng3.

3. Create a MySQL group and user

[Root @ localhost ~] # Groupadd MySQL

[Root @ localhost ~] # Useradd-G MySQL

4. File editing permission

[Root @ localhost ~] # Chmod 755 mysql-5.0.75.tar.gz

5. Compile and install centos MySQL

Decompress:

[Root @ localhost ~] # Tar zxvf mysql-5.0.75.tar.gz

Go to the MySQL installation package

[Root @ localhost ~] # Cd mysql-5.0.75

Configuration parameters

[Root @ localhost ~] #./Configure
-- Prefix =/usr/local/MySQL -- With-extra-charsets = all
-- With-Unix-socket-Path =/usr/local/MySQL/var/MySQL. Sock
-- With-named-Curses-libs =/usr/lib/libncursesw. so.5

Pre-compile

[Root @ localhost ~] # Make

Install

[Root @ localhost ~] # Make install

6. Preparing centos MySQL installation is only the first step. We also need to prepare centos MySQL

 
In general, centos MySQL is looking for the configuration file my. CNF, which is located in the/etc directory, so we have to put the file my. CnF in the/etc/directory.

Let the centos MySQL Server find it when it is started. We have installed centos
After MySQL, the preparation file should be in the/usr/local/MySQL/share/MySQL directory, the preparation file has a few, such as my-huge.cnf
My-medium.cnf my-large.cnf
My-small.cnf, different traffic sites and different preparation of the server environment, of course, need to have different preparation files.

Under normal circumstances, the preparation of my-medium.cnf files can meet most of our needs;

Go to the/usr/local/MySQL directory,

Check whether it has been installed ??
[Root @ localhost ~] # Cd/usr/local/MySQL/
[Root @ localhost ~] # Ls
Bin include info lib libexec man mysql-test share SQL-Example

We copy the my-medium.cnf under the/usr/local/MySQL/share/MySQL directory as my. CNF to the/etc directory.

[Root @ localhost ~] # Cp/usr/local/MySQL/share/MySQL/my-medium.cnf/etc/My. CNF

After doing this, you have to create a centos MySQL authorization table. Otherwise, the database cannot be started. Mysql_install_db. This command is used for this purpose.

Centos MySQL installation commands are installed in the/usr/local/MySQL/bin directory.

[Root @ localhost MySQL] #/usr/local/MySQL/bin/mysql_install_db

After running the mysql_install_db command, we can view/usr/local/MySQL and find a var directory.

This directory is used to hold all database locations. For example, after we create the linuxsir database,

The linuxsir directory is in the // usr/local/MySQL/var directory. I should have understood this time.

7. Starting the centos MySQL server may be the easiest, but it cannot be too early, because sometimes permission errors may occur.

When the centos MySQL server is started, it should be mysql. server in the/usr/local/MySQL/share/MySQL directory.

The startup method is:
[Root @ localhost MySQL] #/usr/local/MySQL/share/MySQL. Server start

If it cannot be started, run/usr/local/MySQL/bin/mysqld_safe -- user = root to start it !!

Enter/usr/local/MySQL/share/MySQL. Server start to start the instance.

Now, set the password to 123456/usr/local/MySQL/bin/mysqladmin-u Root Password 123456.

If no error is returned, the description is correct.

Enter/usr/local/MySQL/bin/MySQL-u root-P to manage the installation of centos MySQL.

 

This article from csdn blog: http://blog.csdn.net/jiangfeng08/archive/2010/07/21/5752390.aspx

1. Download MySQL from chinaunix

: Http://download.chinaunix.net/download/0008000/7159.shtml

2. upload to the centos Server

This example is stored in/home/jiangfeng3.

3. Create a MySQL group and user

[Root @ localhost ~] # Groupadd MySQL

[Root @ localhost ~] # Useradd-G MySQL

4. File editing permission

[Root @ localhost ~] # Chmod 755 mysql-5.0.75.tar.gz

5. Compile and install centos MySQL

Decompress:

[Root @ localhost ~] # Tar zxvf mysql-5.0.75.tar.gz

Go to the MySQL installation package

[Root @ localhost ~] # Cd mysql-5.0.75

Configuration parameters

[Root @ localhost ~] #./Configure
-- Prefix =/usr/local/MySQL -- With-extra-charsets = all
-- With-Unix-socket-Path =/usr/local/MySQL/var/MySQL. Sock
-- With-named-Curses-libs =/usr/lib/libncursesw. so.5

Pre-compile

[Root @ localhost ~] # Make

Install

[Root @ localhost ~] # Make install

6. Preparing centos MySQL installation is only the first step. We also need to prepare centos MySQL

 
In general, centos MySQL is looking for the configuration file my. CNF, which is located in the/etc directory, so we have to put the file my. CnF in the/etc/directory.

Let the centos MySQL Server find it when it is started. We have installed centos
After MySQL, the preparation file should be in the/usr/local/MySQL/share/MySQL directory, the preparation file has a few, such as my-huge.cnf
My-medium.cnf my-large.cnf
My-small.cnf, different traffic sites and different preparation of the server environment, of course, need to have different preparation files.

Under normal circumstances, the preparation of my-medium.cnf files can meet most of our needs;

Go to the/usr/local/MySQL directory,

Check whether it has been installed ??
[Root @ localhost ~] # Cd/usr/local/MySQL/
[Root @ localhost ~] # Ls
Bin include info lib libexec man mysql-test share SQL-Example

We copy the my-medium.cnf under the/usr/local/MySQL/share/MySQL directory as my. CNF to the/etc directory.

[Root @ localhost ~] # Cp/usr/local/MySQL/share/MySQL/my-medium.cnf/etc/My. CNF

After doing this, you have to create a centos MySQL authorization table. Otherwise, the database cannot be started. Mysql_install_db. This command is used for this purpose.

Centos MySQL installation commands are installed in the/usr/local/MySQL/bin directory.

[Root @ localhost MySQL] #/usr/local/MySQL/bin/mysql_install_db

After running the mysql_install_db command, we can view/usr/local/MySQL and find a var directory.

This directory is used to hold all database locations. For example, after we create the linuxsir database,

The linuxsir directory is in the // usr/local/MySQL/var directory. I should have understood this time.

7. Starting the centos MySQL server may be the easiest, but it cannot be too early, because sometimes permission errors may occur.

When the centos MySQL server is started, it should be mysql. server in the/usr/local/MySQL/share/MySQL directory.

The startup method is:
[Root @ localhost MySQL] #/usr/local/MySQL/share/MySQL. Server start

If it cannot be started, run/usr/local/MySQL/bin/mysqld_safe -- user = root to start it !!

Enter/usr/local/MySQL/share/MySQL. Server start to start the instance.

Now, set the password to 123456/usr/local/MySQL/bin/mysqladmin-u Root Password 123456.

If no error is returned, the description is correct.

Enter/usr/local/MySQL/bin/MySQL-u root-P to manage the installation of centos MySQL.

 

This article from csdn blog: http://blog.csdn.net/jiangfeng08/archive/2010/07/21/5752390.aspx

Related Article

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.