Ubuntu mysql configuration

Ubuntu mysql configuration


Install

apt-get install mysql-server 

During the setup it will prompts you set root password, be sure to keep in mind importantly!



Check

Login

mysql -u root -p 

then enter the password which set during the setup.

DDL/DML/DDL

  • DDL
COMMOND DESCRIPTION
CREATE create tables/view/object
ALTER alter object
DROP drop databases/tables/view
  • DML
COMMOND DESCRIPTION
SELECT query record from one or multiple tables
INSERT create record
UPDATE update record
DELETE delete record
  • DDL
COMMOND DESCRIPTION
GRANT granted permission
REVOKE recycle permission

and others.



Configuration

Allow NetWork Access

  • Check 3306 port

     netstat -an|grep 3306
     tcp6    0      0     127.0.0.1:3306    LISTEN

    look at that it’s just allow local to access 3306 port

  • Allow access everywhere

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

    comments bind-address = 127.0.0.1

  • Restart Ubuntu

     shutdown -r now
  • Check 3306 port again

     netstat -an|grep 3306
     tcp6    0      0     :::3306    LISTEN

    This means that you can use port 3306 to access mysql success!

Update root access permission

    sudo mysql -u root -p  
    mysql>grant all privileges on *.* to 'root'@'%' identified by 'xxxxxx';

xxxxx is password.
then let settings available.

mysql>flush privileges;​

Restart mysql service

if you have some other custom configuration, such as buffer_pool_size/log_file_size or others, you should restart you mysql service.

service mysql restart 


Finally

Congratulations! you have success resolved Ubuntu Mysql Configuration! now, you can access mysql via mysql client or program success!



 上一篇
 2019博客计划 2019博客计划
2019博客计划博客开通有一段时间了,但是总是不能持之以恒的更新,所以今天特地梳理了一下提纲。关于提纲第一,好的写作提纲可以让你更加丰富的去考虑所要表达的内容第二,让你在即定的范围内写作,不至于偏题,从而更加有利于表达自己的中心思想第三,有
下一篇 
Ubuntu SSH Algorithm negotiation failed Ubuntu SSH Algorithm negotiation failed
Ubuntu SSH Algorithm negotiation failedSituationServer responded"Algorithm negotiation failed" Key exchange with the rem
2016-02-19
  目录