Install MySQL in Linux Red Hat 9.0

Source: Internet
Author: User

If you think it is easy to use SQL server (a powerful database platform on Windows) in WINDOWS, in Linux, isn't MySQL (the best combination with PHP) worth mentioning? There are many detours when installing and using MySQL (the best combination with PHP.

After all, Linux and Windows are quite different. I wrote this article to help beginners like me learn less and get started as soon as possible. The Linux environment in this article is Red Hat 9.0, and MySQL (the best combination with PHP) is 4.0.16.

Install MySQL (the best combination with PHP)

1. Download the Installation File of MySQL (the best combination with PHP)

Install MySQL (the best combination with PHP) using the following two files:

MySQL (best combination with PHP)-server-4.0.16-0.i386.rpm

MySQL (best combination with PHP)-client-4.0.16-0.i386.rpm

Www. mySQL (the best combination with PHP ). com/downloads/mysql(and php ))))))))))-4.0.html. Open this page, find the "Linux x86 RPM downloads" item, find the "Server" and "Client programs" items, and download the above two rpm files.

2. Install MySQL (the best combination with PHP)

The rpm file is a software installation package developed by Red Hat. rpm frees Linux from complicated procedures when installing software packages. The frequently used parameter of this command during installation is-ivh, where I indicates that the specified rmp package will be installed, and V indicates the detailed information during installation, h indicates that the "#" symbol appears during the installation to display the current installation process. This symbol will not be stopped until MySQL installation is complete.

1) install the server

Run the following command in the directory with two rmp files:

[Root @ test1 local] # rpm-ivh MySQL (best combination with PHP)-server-4.0.16-0.i386.rpm

The following information is displayed.

 
 
  1. Warning: MySQL (best combination with PHP)-server-4.0.16-0.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
  2. Preparing... ######################################## ### [100%]
  3. 1: MySQL (the best combination with PHP) -server ###################################### ##### [100%]
  4. ...... (Omitted)
  5. /Usr/bin/MySQL (the best combination with PHP) admin-u root password \ 'new-password \'
  6. /Usr/bin/MySQL (the best combination with PHP) admin-u root-h test1 password \ 'new-password \'
  7. ...... (Omitted)
  8. Starting MySQL (the best combination with PHP) d daemon with databases from/var/lib/MySQL (the best combination with PHP)

If the preceding information is displayed, MySQL is installed on the server. Run netstat to check whether the MySQL (the best combination with PHP) port is opened. If yes, the service is started and the installation is successful. The default port for MySQL (the best combination with PHP) is 3306.

 
 
  1. [root@test1 local]# netstat -nat  
  2. Active Internet connections (servers and established)  
  3. Proto Recv-Q Send-Q Local Address Foreign AddressState  
  4. tcp00 0.0.0.0:33060.0.0.0:* LISTEN  

The above shows that MySQL (the best combination with PHP) service has been started.

2) install the client

Run the following command:

[Root @ test1 local] # rpm-ivh MySQL (best combination with PHP)-client-4.0.16-0.i386.rpm

Warning: MySQL (best combination with PHP)-client-4.0.16-0.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5

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

1: MySQL (the best combination with PHP) -client ###################################### ##### [100%]

The installation of MySQL is complete.

Use the following command to connect to MySQL (the best combination with PHP) and test whether it is successful.

Log on to MySQL (the best combination with PHP)

The command for logging on to MySQL (the best combination with PHP) is MySQL (the best combination with PHP). The syntax for using MySQL (the best combination with PHP) is as follows:

MySQL (best combination with PHP) [-u username] [-h host] [-p [password] [dbname]

Username and password are the username and password of MySQL (the best combination with PHP) respectively, and the initial management account of MySQL (the best combination with PHP) is root without a password. Note: this root user is not a Linux User. MySQL (the best combination with PHP) is the root user by default. Since there is no password at first, you only need to type MySQL (the best combination with PHP) for the first entry.

 
 
  1. [Root @ test1 local] # MySQL (best combination with PHP)
  2. Welcome to the MySQL (the best combination with PHP) monitor. Commands end with; or \ g.
  3. Your MySQL (best combination with PHP) connection id is 1 to server version: 4.0.16-standard
  4. Type \ 'help; \ 'or \' \ h \ 'for help. Type \' \ c \ 'to clear the buffer.
  5. MySQL (the best combination with PHP)>

The prompt "MySQL (the best combination with PHP)>" appears. Congratulations! MySQL is installed successfully!

The logon format after the password is added is as follows:

MySQL (best combination with PHP)-u root-p

Enter password: (Enter the password)

-U is followed by the user name.-p requires the password. Press enter and enter the password at the Enter password.

Note: This MySQL (the best combination with PHP) file is in the/usr/bin directory, and the Startup file/etc/init described later. d/MySQL (the best combination with PHP) is not a file.

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.