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)
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 4 to server version: 4.0.16-standard
- Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
- 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.