ubuntu mysql installation, configuration, simple to use, is connected Navicat

MySQL Installation

1. First install the update apt center: apt update there will be a default latest mysql package.

2. Install msyql: sudo apt-get install mysql-server mysql-server server instance, to establish a connection mysql-client client and server.

 

 At 1 mark must be capitalized.

After 3.mysql installation probably will take up 160M of storage space.

4.mysql configuration files installed by default in cd / etc / mysql folder

 

MySQL Configuration

Under 1.ubuntu mysql start stop command

  Stop immediately: service mysql stop

  Restart service: service mysql restat

  Start the service: service mysql start

MySQL service does not start when: native footprint 275M, after starting mysql non-transport consumes memory footprint 434M 160M

2. mysql configuration file Introduction

  MySQL official document: https: //dev.mysql.com/doc/refman/5.7/en/ MySQL version 5.7 is here

  MySQL configuration file documentation: https: //dev.mysql.com/doc/refman/5.7/en/server-administration.html

  Configuration file path: root configuration file is a cat /etc/mysql/my.cnf

 

 

 

 The actual profile address in the red box

 

 

Simple to use:

  1. In the console input mysql can establish a connection with the MySQL

  2. Initial Initial incoming account password is provided: update mysql.user set authentication_string = password ( '123456') where user = 'root' and Host = 'localhost'; flush privileges;

  

 

   3.quit; exit mysql

  4. account password mysql -u account password -P -p port number of parameters and values ​​must be written together or will report ERROR 1049 (42000): Unknown database '123456' error

   

   Here 5. After setting the connection with the server navicat, and can not connect to the local service mysql

  

 

  The solution: to mysql server resides

    1. use mysql; select user, authentication_string, host from user; there is only found host ip host to other open access.

    

 

     2. open access

     GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

    flush privileges;

    quit;

    Found still can not access, then take a look at the firewall turn off the firewall: sudo ufw disable still can not access.

    4. Check whether mysql configuration file is bound 127.0.0.1

    vim /etc/mysql/my.cnf found no bind-address, but my.cnf has introduced two additional folders in a file inside /etc/mysql/mysql.conf.d/mysqld.cnf

    vim /etc/mysql/mysql.conf.d/mysqld.cnf

    

 

    And then restart the mysql service mysql restart the service connection is successful

    

 

 

  

  

 

     

 

 

 

 

 

 

    

 

Guess you like

Origin www.cnblogs.com/blogxiao/p/11469272.html