This step-by-step tutorial teaches you how to install MySQL in Linux

Source: Internet
Author: User

Finally, mysql is successfully installed on linux. I am excited to write this article to commemorate it. By the way, I will take a note so that I can refer to it in the future when I encounter problems.

First, let's take a look at all the packages needed for installation.

[Root @ localhost6 mysql] # ls

Mysql-5.0.37-2.fc7.i386.rpm mysql-server-5.0.37-2.fc7.i386.rpm unixODBC-2.2.12-2.fc7.i386.rpm

Mysql-connector-odbc-3.51.12-2.2.i386.rpm perl-DBD-MySQL-3.0008-1.fc7.i386.rpm

Mysql-libs-5.0.37-2.fc7.i386.rpm perl-DBI-1.53-2.fc7.i386.rpm

The next step is to install the database. Because each package has a certain dependency, it is recommended that you install the package according to the installation sequence. Although I dare not say this is the only correct order, but at least it is feasible to follow the order.

[Root @ localhost6 mysql] # rpm-ivh perl-DBI-1.53-2.fc7.i386.rpm

Warning: perl-DBI-1.53-2.fc7.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Preparing... ######################################## ### [100%]

1: perl-DBI ##################################### ###### [100%]

[Root @ localhost6 mysql] # rpm-ivh perl-DBD-MySQL-3.0008-1.fc7.i386.rpm

Warning: perl-DBD-MySQL-3.0008-1.fc7.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Preparing... ######################################## ### [100%]

1: perl-DBD-MySQL ################################### ####### [1, 100%]

[Root @ localhost6 mysql] # rpm-ivh mysql-libs-5.0.37-2.fc7.i386.rpm

Warning: mysql-libs-5.0.37-2.fc7.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Preparing... ######################################## ### [100%]

1: mysql-libs ##################################### ###### [100%]

[Root @ localhost6 mysql] # rpm-ivh mysql-5.0.37-2.fc7.i386.rpm

Warning: mysql-5.0.37-2.fc7.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Preparing... ######################################## ### [100%]

1: mysql ####################################### #### [100%]

[Root @ localhost6 mysql] # rpm-ivh mysql-server-5.0.37-2.fc7.i386.rpm

Warning: mysql-server-5.0.37-2.fc7.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Preparing... ######################################## ### [100%]

1: mysql-server ##################################### ###### [100%]

So far, the entire mysql has been installed. Next, start the mysql daemon. The process is roughly as follows:

[Root @ localhost6 mysql] # chown-R mysql: mysql/var/lib/mysql

[Root @ localhost6 mysql] #/etc/init. d/mysqld start

Initialize MySQL database: Installing all prepared tables

Fill help tables

To start mysqld at boot time you have to copy support-files/mysql. server

To the right place for your system

Please remember to set a password for the MySQL root USER!

To do so, start the server, then issue the following commands:

/Usr/bin/mysqladmin-u root password 'new-password'

/Usr/bin/mysqladmin-u root-h localhost6.localdomain6 password 'new-password'

See the manual for more instructions.

You can start the MySQL daemon:

Cd/usr;/usr/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'SQL-Shanghai' directory:

Cd SQL-scripts; perl run-all-tests

Please report any problems with the/usr/bin/mysqlbug script!

The latest information about MySQL is available on the web

Http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

[OK]

Start MySQL: [OK]

When you see the above page, congratulations, you have installed successfully. Now you only need to enter mysql on the terminal. Let's try to start mysql.

[Root @ localhost6 mysql] # mysql

Welcome to the MySQL monitor. Commands end with; or \ g.

Your MySQL connection id is 2

Server version: 5.0.37 Source distribution

Type 'help; 'or' \ H' for help. Type '\ C' to clear the buffer.

Started successfully.

Mysql> quit;

Bye

Logout successful.

However, in general, you must use other languages to connect to mysql for development. Therefore, you must install odbc. The installation process is as follows.

[Root @ localhost6 mysql] # rpm-ivh unixODBC-2.2.12-2.fc7.i386.rpm

Warning: unixODBC-2.2.12-2.fc7.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Preparing... ######################################## ### [100%]

1: unixODBC ####################################### #### [100%]

[Root @ localhost6 mysql] # rpm-ivh mysql-connector-odbc-3.51.12-2.2.i386.rpm

Warning: mysql-connector-odbc-3.51.12-2.2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Preparing... ######################################## ### [100%]

1: mysql-connector-odbc ################################### ####### [1, 100%]

Odbc is also installed successfully. Now you can use mysql for development. As for how to set and use mysql, it depends on your understanding of mysql. I hope this article will help other cainiao like me.

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.