Installation a: RPM package installation:
Test environment: centOS5.5, with a built-in MYSQL5.0.2
See if the installed MYSQL: # rpm-qa | grep mysql (note capitalization)
If the screen will display the installed package name such as mysql: mysql-5.0.22-188.8.131.52 Uninstall:
One way: Open gnome "Applications - Add / Remove Programs" to remove one of the MYSQL, can be safely removed from the associated software.
Second way: force delete: # rpm-e - nodeps mysql-5.0.22-184.108.40.206 (nodeps said forcibly remove)
Again find the package name, if not the resulting output indicates the version of mysql has been unloaded;
Second, download the installation package:
Open and download: http://dev.mysql.com/downloads/mysql/ # Downloads (command download is: wget http:// ...)
Note: centOS choose Linux Generic under Linux - Generic 2.6 (x86, 32-bit, MySQL-5.5.12-1.linux2.6.i386.tar)
This package has all the required packages, and the compressed packages:
· MySQL-client-VERSION.i386.rpm standard MySQL client programs. You may always want to install the package.
· MySQL-devel-VERSION.i386.rpm libraries and include files, if you want to compile other MySQL clients, such as Perl modules, you need to.
· MySQL-embedded-VERSION.i386.rpm embedded MySQL server library (from MySQL 4.0 onwards).
MySQL server. You need this option unless you want to connect on another machine running the MySQL server. Note: In MySQL 4.0.10, the server RPM file is called MySQL-VERSION.i386.rpm. In other words, do not contain the name-server.
· MySQL-shared-VERSION.i386.rpm This package contains some language, and applications need to dynamically load shared libraries (libmysqlclient.so *)
Extract the server and client both.
Third, the installation
1, the installation server: # rpm-ivh MySQL-server .... rpm (at the version of the character is omitted)
2, show after a successful installation of the client # rpm-ivh MySQL-client ....
RPM some options:
- Replacepkgs cover installation
- Test and not a true test installation installation
- Replacefiles version conflict error messages to resolve skip the installation
Fourth, after the installation:
1, see 3306 port: # netstat-hat and telnet localhost 3306
2, change the password: # / usr / bin / mysqladmin-u root password 'new-password'
3, add a group:
# Vi / etc / passwd by G to the last page to see if the mysql user. Then: q to exit,
# Vi / etc / group to see if there are mysql group if no group is # groupadd mysql, mysql user if not then # useradd-g mysql mysql
mysql mysql group and the members are present, gpasswd-a mysql mysql in the user added to the MYSQL
4, start, restart the mysql service:
service mysql restart
service mysql start
Finally, mysql-u root login when prompted
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/ var / lib / mysql / mysql.sock' (2)
Has not been resolved. So I had to try to compile the source code installed