How to install MySQL in linux

Source: Internet
Author: User

We are going to discuss with you the installation steps of linux MySQL. I saw the installation steps of linux MySQL on the relevant website two days ago and thought it was quite good. So I would like to share it with you, the following is a detailed description of the relevant content.

Linux Server RedHat 5.0.server.

MySQL version:

MySQL Server: MySQL-server-community-5.1.38-0.rhel5.i386.rpm

MySQL client: MySQL-client-community-5.1.38-0.rhel5.i386.rpm

1. First, load the optical drive:

Mount/dev/cdrom/mnt

2 linux MySQL installation directory:

The following describes these directories.

1. Database directory

/Var/lib/MySQL/

2. Configuration File

/Usr/share/MySQLMySQL. server command and configuration file)

3. Related commands

/Usr/bin (commands such as MySQLadmin MySQLdump)

4. Start the script

/Etc/rc. d/init. d/directory of the MySQL STARTUP script file)

5. Change the logon Password

MySQL does not have a password by default. It is self-evident that the password is added after installation.

1. Commands

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

Format: MySQLadmin-u username-p old password New password

Add a 123456 password to the root user.

Type the following command:

[Root @ test1 local] #/usr/bin/MySQLadmin-u root password 123456

Note: because the root account does not have a password at the beginning, the old-p password can be omitted.

3. test whether the modification is successful

1) login without a password

[Root @ test1 local] # MySQL

ERROR 1045: Access denied for user: 'root @ localhost' (Using password: NO)

An error is displayed, indicating that the password has been modified.

2) log on with the modified Password

[Root @ test1 local] # MySQL-u root-p

Enter password: (Enter the password 123456 after modification)

 
 
  1. Welcome to the MySQL monitor. Commands end with ; or \g.   
  2. Your MySQL connection id is 4 to server version: 4.0.16-standard   
  3. Type 'help;' or '\h' for help. Type '\c' to clear the buffer.   
  4. MySQL>  

Successful!

You can use the MySQLadmin command to change the password or the database to change the password. The above content is an introduction to the installation of linux MySQL. I hope you will have some gains.

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.