天天看点

Install Mysql in Linux OS

Software: http://www.mysql.com/downloads/mysql/5.1.html#downloads

MySQL-client-community-5.1.66-1.rhel5.i386.rpm

MySQL-server-community-5.1.66-1.rhel5.i386.rpm

  1. [root@localhost software]# rpm -ivh MySQL-server-community-5.1.66-1.rhel5.i386.rpm 
  2. Preparing...                ########################################### [100%] 
  3.         file /usr/share/mysql/charsets/README from install of MySQL-server-community-5.1.66-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.61-4.el6.i686 
  4.         file /usr/share/mysql/charsets/Index.xml from install of MySQL-server-community-5.1.66-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.61-4.el6.i686 
  5.         file /usr/share/mysql/charsets/armscii8.xml from install of MySQL-server-community-5.1.66-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.61-4.el6.i686 
  6.         file /usr/share/mysql/charsets/ascii.xml from install of MySQL-server-community-5.1.66-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.61-4.el6.i686 
  7.         file /usr/share/mysql/charsets/cp1250.xml from install of MySQL-server-community-5.1.66-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.61-4.el6.i686 
  8.         file /usr/share/mysql/charsets/cp1251.xml from install of MySQL-server-community-5.1.66-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.61-4.el6.i686 
  9.         file /usr/share/mysql/charsets/cp1256.xml from install of MySQL-server-community-5.1.66-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.61-4.el6.i686 
  10. [root@localhost share]# yum -y remove mysql-libs-5.1.61* 
  11. Removed: 
  12.   mysql-libs.i686 0:5.1.61-4.el6                                           Dependency Removed: 
  13.   cronie.i686 0:1.4.4-7.el6      cronie-anacron.i686 0:1.4.4-7.el6      crontabs.noarch 0:1.10-33.el6      postfix.i686 2:2.6.6-2.2.el6_1      sysstat.i686 0:9.0.4-20.el6      
  14. Complete! 
  15. [root@localhost software]# rpm -ivh MySQL-server-community-5.1.66-1.rhel5.i386.rpm 
  16. Preparing...                ########################################### [100%] 
  17.    1:MySQL-server-community ########################################### [100%] 
  18. PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! 
  19. To do so, start the server, then issue the following commands: 
  20. /usr/bin/mysqladmin -u root password 'new-password' 
  21. /usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password' 
  22. Alternatively you can run: 
  23. /usr/bin/mysql_secure_installation 
  24. which will also give you the option of removing the test 
  25. databases and anonymous user created by default.  This is 
  26. strongly recommended for production servers. 
  27. See the manual for more instructions. 
  28. Please report any problems with the /usr/bin/mysqlbug script! 
  29. Starting MySQL. SUCCESS!  
  30. Giving mysqld 2 seconds to start 
  31. [root@localhost software]# rpm -ivh MySQL-client-community-5.1.66-1.rhel5.i386.rpm 
  32. Preparing...                ########################################### [100%] 
  33.    1:MySQL-client-community ########################################### [100%] 
  34. [root@localhost software]#  
  35. [root@localhost software]#  
  36. [root@localhost software]# /usr/bin/mysqladmin -u root password 'pass' 
  37. [root@localhost software]# mysql -u root -ppass 
  38. Welcome to the MySQL monitor.  Commands end with ; or \g. 
  39. Your MySQL connection id is 2 
  40. Server version: 5.1.66-community MySQL Community Server (GPL) 
  41. Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. 
  42. Oracle is a registered trademark of Oracle Corporation and/or its 
  43. affiliates. Other names may be trademarks of their respective 
  44. owners. 
  45. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 
  46. mysql> exit 
  47. Bye 
  48. [root@localhost software]#