Linux installation MySQL database--yum installation method

Source: Internet
Author: User

MySQL database has a variety of installation methods, this article only describes the most practical and fastest MySQL server installation method on Linux servers.one, Linux server yum installation (CentOS6.3 64-bit)All commands executed on the server are at the end of # 1, command installation mysql# yum install MySQL mysql-server mysql-devel-y last prompt complete!   indicates successful installation  2, Check whether the Mysqld service is generated and set the random start # chkconfig--list |grep mysql  Digital Code Server start level,off   representative does not randomly start the mysqld service, On means random start service we need to set mysqld random start, execute the following command to set # Chkconfig mysqld on such a result represents normal # Chkconfig--list |grep mysql     3, start mysqld Service execute the following command to start, both methods can: #/etc/init.d/mysqld start     # service mysqld start  Start after PS a bit to see if the process is up # Ps-ef |grep mysql|grep-v greproot      1582     1 & Nbsp;0 23:26 pts/0    00:00:00/bin/sh/usr/bin/mysqld_safe--datadir=/var/lib/mysql--socket=/var/lib/mysql/ Mysql.sock--pid-file=/var/run/mysqld/mysqld.pid--basedir=/usr--user=mysqlmysql     1684   1582  1 23:26 pts/0    00:00:00/usr/libexec/mysqld--basedir=/usr--datadir=/var/lib /mysql--user=mysql--log-error=/var/log/mysqld.log--pid-file=/var/run/mysqld/mysqld. PID--socket=/var/lib/mysql/mysql.sock According to the process information can be seen, MySQL database data directory is/var/lib/mysql, error log file is   /var/log/ mysqld.log  See which libraries # cd/var/lib/mysql# ls-l  found two libraries, all of which are MySQL default, and how to create a database manually is explained in the following tutorial.   View occupied ports, default 3306 Port # NETSTAT-NUTLP | grep mysqltcp        0      0 0.0.0.0:3306                 0.0.0.0:*                    listen      1684/mysqld   4, stop mysqld service to stop the following command, both methods can: #/etc/ Init.d/mysqld stop   # Service mysqld stop 5, restart MYSQLD Service perform the following command to restart, both methods can: #/etc/init.d/mysqld restart # service mysqld srestart 6, command line test connection MySQL, subsequent can directly manage the database directly in the command line execution, yum installed MySQL, the local root password default is empty # MYSQL7, set the initial password \ Permission to set a new password and also grant a limit of mysql> set password for [email protected] = password (' 123 '); Refresh to make it effective mysql> flush privileges; Exit Mysql> exit; 8, re-login to see if the new password and permissions are in effect mysql> [[EMAIL PROtected]_redhat bin]# mysql-u root-penter Password: "Enter password for settings"   Show full processlist; View database statusNavicat Connection Error Resolved:Update user set Password=password ("123") where user= "root";

Linux installation MySQL database--yum installation method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.