查看: 95|回复: 0

[Ubuntu] ubuntu安装mysql5.6

[复制链接]

1

主题

0

回帖

0

积分

热心网友

金币
0
阅读权限
220
精华
0
威望
0
贡献
0
在线时间
0 小时
注册时间
2011-5-21
发表于 2020-3-17 14:33:00 | 显示全部楼层 |阅读模式

 

安装mysql5.6
在ubuntu上安装mysql5.6的版本

1.添加mysql5.6的源

sudo apt-get install software-properties-common
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty universe'

 

2.安装mysql5.6

sudo apt-get update
sudo apt install mysql-server-5.6
sudo apt install mysql-client-5.6

 

安装mysql server的时候需要手动配置root密码:


3.设置开机自启

update-rc.d mysql defaults


4.创建或修改 my.cnf 文件
在/etc/mysql/目录下添加 my.cnf文件

sudo vim /etc/mysql/my.cnf


复制下面的内容,并保存文件

# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

!includedir /etc/mysql/conf.d/
# add here
[mysqld]
default-time_zone = '+8:00'
lower_case_table_names=1

 

5.重启Mysql服务

sudo service mysql restart

 

启动/停止 Mysql

> sudo /etc/init.d/mysql start

> sudo /etc/init.d/mysql stop

 

 

修改root密码

 

sudo /usr/local/mysql/bin/mysqladmin -u root password abc



原文链接:https://blog.csdn.net/qq_36641556/article/details/80921737

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

圆梦公社,专注于为全球华人提供纯粹技术交流的地方,请勿发布任何政治及违法的言论。如有相关侵权、举报、投诉及建议等,请发 E-mail:dzh188@hotmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部