美文网首页
Linux安装mysql(Ubuntu)

Linux安装mysql(Ubuntu)

作者: Youngmon | 来源:发表于2019-12-26 11:12 被阅读0次

一、安装

apt-get update
apt-get install mysql-server
sudo apt-get install mysql-client
apt-get install libmysqlclient-dev

二、配置

#连接mysql

mysql -u root -p

2.1.建库授权

create database jz default character set utf8 collate utf8_general_ci;

create user 'admin'@'%' identified by 'root';

grant all privileges on *.* to admin;

grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;

grant all privileges on *.* to 'admin'@'%' identified by 'root' with grant option;
 
 
FLUSH PRIVILEGES;

2.2.配置文件

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

bind-address = 0.0.0.0
lower_case_tables_name = 1

#停止
/etc/init.d/mysql stop

#启动
/etc/init.d/mysql start

netstat -nltp  | grep 3306 

相关文章

网友评论

      本文标题:Linux安装mysql(Ubuntu)

      本文链接:https://www.haomeiwen.com/subject/ptkggctx.html