first, easy installation
#yum install-y mysql-server MySQL mysql-devel
If the installation package conflict is reported:
File/usr/share/mysql/ukrainian/errmsg.sys from install of mysql-server-5.5.18-1.rhel5.i386 conflicts with file from Package mysql-libs-5.0.46-1.rhel5.i386
Uninstall the installation package.
#yum-y remove mysql-libs-5.0.46-1.rhel5.i386-y means no need to ask if remove
After uninstalling, install MySQL successfully
Second, manual installation
1. Upload the installation package first
/OPT/MYSQL-SERVER-4.0.16-0.I386.RPM/OPT/MYSQL-CLIENT-4.0.16-0.I386.RPM (subject to availability, not necessarily installed)
2. Add Execute permission to file
#cd/opt/Switch to the development directory
#chmod a+x mysql-server-4.0.16-0.i386.rpm To add execution permissions to a file
3. Perform the installation
#rpm-IVH mysql-server-4.0.16-0.i386.rpm
If the installation process reports the following error: File/usr/share/mysql/charsets/cp1251.xml from install of mysql-server-5.5.24-1.el6.i686 conflicts with File from package Mysql-libs-5.1.52-1.el6_0.1.i686file/usr/share/mysql/czech/errmsg.sys from install of mysql-server-5.5.24-1.el6.i686 conflicts with file from the package mysql-libs-5.1.52-1.el6_0.1.i686
The cause is caused by a packet conflict! The operating system comes with some packages that conflict with the MySQL package, first removing the conflicting libs package, and installing
#yum-y remove mysql-libs-5.1.52*-y means no need to ask if remove
Error:failed dependencies:libc.so.6 is needed by mysql-server-community-5.1.63-1.rhel4.i386 libc.so.6 (GLIB c_2.0) is needed by mysql-server-community-5.1.63-1.rhel4.i386 libc.so.6 (glibc_2.1) was needed by Mysql-server-commu Nity-5.1.63-1.rhel4.i386
#yum Install libc.so.6
After the uninstallation is complete, install MySQL again
#rpm-IVH mysql-server-4.0.16-0.i386.rpm
third, set the root passwordNewly installed MySQL, default user root no password, need to set password
#/usr/bin/mysqladmin-u root-p ' 123456 '
If an error is displayed, the display does not have permission to connect Mysqladmin:connect to server at ' localhost ' failederror: ' Access denied for user ' root ' @ ' localhost ' (using P Assword:yes) '
Workaround:
Close the database first #service mysqld stop
Start with a no-check-safe method # Mysqld_safe--user=mysql--skip-grant-tables--skip-networking &
Login #mysql-u root MySQL again
Change Password # UPDATE user SET Password=password (' NewPassword ') where user= ' root ' and host= ' root ' or host= ' localhost '; #FLUSH privi Leges;
Restart Mysql#service mysqld restart or #ps–aux | grep mysqld command to find the MySQL process number and then execute the kill-9 process number to kill the MySQL process
four, authorized remote user loginNew installation of MySQL, the default is only native to log on, other computers through the network login need to authorize
First login #/usr/bin/mysql-uroot-p
Re-authorize #grant all on * * to [email protected] '% ' identified by ' 123456 '; #flush privileges;
Well, at this point, MySQL is basically ready to use.
Install MySQL under Linux