Debian8 install mysql5.6 and simple configuration _ MySQL

Source: Internet
Author: User
Install mysql56 automatically. this is the information about DownloadMySQLAPTRepository on the mysql website [http: devmysqlcomdownloadsrepoapt]. on this page, find the following connection: [http: devmysqlco install mysql5.6 automatically
This is the mysql official site on the Download MySQL APT Repository information [http://dev.mysql.com/downloads/repo/apt/] by searching on this page, find the following connection [http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/] page and instruct users how to install mysql corresponding to different versions of information
For debian8
Wget http://dev.mysql.com/get/mysql-apt-config_0.3.6-1debian8_all.debdpkg-I mysql-apt-config_0.3.6-1debian8_all.deb in the pop-up page select use apply mode, this will write the URLs of some resources to the source-list file and then perform sudo apt-get update on the developed version of the installation sudo apt-get install mysql-server-5.6
Change the storage location of mysql data
The content of the original my. cnf file is
[client]port            = 3306socket          = /var/run/mysqld/mysqld.sock[mysqld_safe]pid-file        = /var/run/mysqld/mysqld.pidsocket          = /var/run/mysqld/mysqld.socknice            = 0[mysqld]user            = mysqlpid-file        = /var/run/mysqld/mysqld.pidsocket          = /var/run/mysqld/mysqld.sockport            = 3306basedir         = /usrdatadir         = /var/lib/mysqltmpdir          = /tmplc-messages-dir = /usr/share/mysqlexplicit_defaults_for_timestamp# Instead of skip-networking the default is now to listen only on# localhost which is more compatible and is not less secure.bind-address    = 127.0.0.1log-error       = /var/log/mysql/error.log# Recommended in standard MySQL setupsql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES# Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links=0# * IMPORTANT: Additional settings that can override those from this file!#   The files must end with '.cnf', otherwise they'll be ignored.#!includedir /etc/mysql/conf.d/
My. cnf file after modification
1. modify the mysql character set. storage path modification 3. system Log modification [client] port = 3306 socket =/var/run/mysqld. sockdefault-character-set = utf8 [mysqld_safe] pid-file =/var/run/mysqld. pidsocket =/var/run/mysqld. socknice = 0 [mysqld] user = mysqlpid-file =/var/run/mysqld. pidsocket =/var/run/mysqld. sockport = 3306 basedir =/usr # datadir =/var/lib/mysqldatadir =/mnt/mysqltmpdir =/tmplc-messages-dir =/Usr/share/mysqlexplicit_defaults_for_timestampcharacter-set-server = utf8 # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. bind-address = 127.0.0.1log-error =/var/log/mysql/error. log # Recommended in standard MySQL setupsql_mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES # Disabling symbolic-links is recommended to preve Nt assorted security riskssymbolic-links = 0 # * IMPORTANT: Additional settings that can override those from this file! # The files must end with '. cnf', otherwise they'll be ignored .#! Includedir/etc/mysql/conf. d/
Note: Before modifying the storage path, you must use mysql_install_db
Sudo/usr/bin/mysql_install_db -- user = mysql -- basedir =/usr/-- datadir =/mnt/mysql then start mysqld_safe & you can start mysql
Mysql restart command
sudo service mysql restartsudo service mysql stopsudo service mysql startsudo /etc/init.d/mysql start | stop | restart

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.