Configure MySQL under Fedora5 (MySQL documents of great reference include how to move the MySQL database location in the linux File System)
1. Download the MySQL Installation File
To fully install MySQL, the following six files are required:
MySQL-server-community-5.1.26-0.rhel4.i386.rpm
MySQL-client-community-5.1.26-0.rhel4.i386.rpm
MySQL-shared-community-5.1.26-0.rhel4.i386.rpm
MySQL-devel-community-5.1.26-0.rhel4.i386.rpm
MySQL-test-community-5.1.26-0.rhel4.i386.rpm
MySQL-community-debuginfo-5.1.26-0.rhel4.i386.rpm
For: http://dev.mysql.com/downloads/mysql/5.1.html#linux-rhel4-x86-32bit-rpms, open this page (because the Fedora version is not found, replace it with Redhat Enterprise 4, no problem) and download all the required rpm files above.
Ii. Install MySQL
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 stop until the installation is complete.
1) MySQL Server Installation
Run the following command in the directory with two rmp files: [root @ test1 local] # rpm-ivh MySQL-server *. rpm (* is a wildcard, saving a lot of input, which is very convenient -:)))
The following message is displayed: Failed dependencies: perl (DBI) is needed by MySQL-server-5.1.26-0.rhel4.i386 error!
Go to Google and find that there may be a lot of additional dependency checks added in this version of rpm, especially for all perl modules dependency checks, therefore, it is safe to use "-- nodeps" to force installation. I did this: rpm-ivh MySQL-server *. rpm -- nodeps; the result is successful:
Preparing... [100%]
1: MySQL-server [100%]
2) install the client in MySQL
Run the following command:
[Root @ test1 local] # rpm-ivh MySQL-client *. rpm
Preparing... [100%]
1: MySQL-client [100%]
There should be no problem with installing the other four rpm files above.
Iii. MySQL Logon
The MySQL logon command is mysql. the syntax of mysql is as follows: mysql [-u username] [-h host] [-p [password] [dbname] username and password are MySQL user names and passwords respectively, and mysql's initial management account is root, no Password. Note: This root user is not a Linux User. The default MySQL user is root. Because there is no password at first, you only need to type mysql for the first time.
[Root @ test1 local] # mysql
Welcome to the MySQL monitor. Commands end with; or g.
Your MySQL connection id is 1 to server version: 4.0.16-standard
Type 'help; 'or 'H' for help. Type 'C' to clear the buffer.
Mysql>
The prompt "mysql>" appears. Congratulations! The installation is successful!
The logon format after the password is added is as follows:
Mysql-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.
However, an error occurred when I entered mysql:
The initial password is empty. Is it empty or incorrect!
ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: NO)
MySQL installation solution: reset the password
#/Etc/init. d/mysql stop
# Mysqld_safe -- user = mysql -- skip-grant-tables -- skip-networking &
# Mysql-u root mysql
Mysql> UPDATE user SET Password = PASSWORD ('newpassword') where USER = 'root ';
Mysql> flush privileges;
Mysql> quit
#/Etc/init. d/mysqld restart
# Mysql-uroot-p
Enter password:
Mysql> done!