博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ubuntu Mysql 安装与配置
阅读量:4042 次
发布时间:2019-05-24

本文共 1046 字,大约阅读时间需要 3 分钟。

环境:

Ubuntu 18.04.2

1> 在线安装

sudo apt install mysql-server mysql-client

sudo apt libmysqlclient-dev //可选

2> 推荐配置

打开配置文件:

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

在[mysqld]下:

添加:
#中文支持
character-set-server=utf8
#存储过程group_concat函数拼接长度限制
group_concat_max_len = 1024000

修改:

#最大文件接收限制
max_allowed_packet = 200M

重启服务:

sudo service mysql restart

3> 常规操作

修改登录密码:

Mysql 5.7:

update mysql.user set authentication_string=password("123456"), plugin="mysql_native_password" where user='root';flush privileges;

//查询

select host,user,authentication_string,plugin from mysql.user;

旧版:

update mysql.user set password = password('123456') where user = 'root';flush privileges;

//查询

select host,user,password,plugin from mysql.user;

大文件导入使用指令:

mysql -uroot -p dbname < bigdata.sql

备份数据库:

mysqldump -u root -p dbname > dbname.sql

备份数据库表:

mysqldump -u root -p dbname tbname > tbname.sql

创建登录账户:

grant all on *.* to user_name@'%' identified by 'user_password';

开启外网连接:

打开配置文件/etc/mysql/mysql.conf.d/mysqld.cnf
把配置项”bind-address = 127.0.0.1”注释

重启服务:

sudo service mysql restart

转载地址:http://oyhdi.baihongyu.com/

你可能感兴趣的文章
Spring JTA应用之JOTM配置
查看>>
spring JdbcTemplate 的若干问题
查看>>
Servlet和JSP的线程安全问题
查看>>
GBK编码下jQuery Ajax中文乱码终极暴力解决方案
查看>>
Oracle 物化视图
查看>>
PHP那点小事--三元运算符
查看>>
解决国内NPM安装依赖速度慢问题
查看>>
Brackets安装及常用插件安装
查看>>
Centos 7(Linux)环境下安装PHP(编译添加)相应动态扩展模块so(以openssl.so为例)
查看>>
fastcgi_param 详解
查看>>
Nginx配置文件(nginx.conf)配置详解
查看>>
标记一下
查看>>
IP报文格式学习笔记
查看>>
autohotkey快捷键显示隐藏文件和文件扩展名
查看>>
Linux中的进程
查看>>
学习python(1)——环境与常识
查看>>
学习设计模式(3)——单例模式和类的成员函数中的静态变量的作用域
查看>>
自然计算时间复杂度杂谈
查看>>
当前主要目标和工作
查看>>
使用 Springboot 对 Kettle 进行调度开发
查看>>