2018更新
ubuntu最新安装可按照此步骤:
1.安装mysql
#命令1
sudo apt-get update
#命令2
sudo apt-get install mysql-server
输入Y确认,中间会弹出让输入root用户密码,输入一遍下一步再输入确认一遍;
2.配置mysql
sudo mysql_secure_installation
配置项较多,如下所示:
#1
VALIDATE PASSWORD PLUGIN can be used to test passwords...
Press y|Y for Yes, any other key for No: N (我的选项)
#2
Please set the password for root here...
New password: (输入密码)
Re-enter new password: (重复输入)
#3
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them...
Remove anonymous users? (Press y|Y for Yes, any other key for No) : N (我的选项)
#4
Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network...
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y (我的选项)
#5
By default, MySQL comes with a database named 'test' that
anyone can access...
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : N (我的选项)
#6
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y (我的选项)
3.检查mysql服务状态
systemctl status mysql.service
看到active(running)字样证明启动正常
4.配置远程访问
先去 /etc/mysql/my.cnf 或者 /etc/mysql/mysql.conf.d/mysqld.cnf 找到如下配置项:
bind-address = 127.0.0.1
修改为:
bind-address = 0.0.0.0
然后进入mysql
mysql -u root -p password
password为安装步骤时你设置的root密码
grant all privileges on *.* to root@"%" identified by "password" with grant option;
password同上,然后依次执行如下命令:
flush privileges;
exit
/etc/init.d/mysql restart
结束,旧版 ubuntu 或 CentOS6 参考如下安装
————————————
安装
64位tar: http://dev.mysql.com/downloads/file/?id=459257
32位tar:http://dev.mysql.com/downloads/file/?id=459256
压缩包
64位tar.gz:http://dev.mysql.com/downloads/file/?id=459272
64位tar.gz:http://dev.mysql.com/downloads/file/?id=459273
-----------------------------
5.5.46
tar:http://dev.mysql.com/downloads/file/?id=459035
tar.gz:http://dev.mysql.com/downloads/file/?id=459051
1安装:rpm
l 步骤1:检查是否已经安装mysql,如果安装删除。
--nodeps表示:不验证套件档的相互关联性。
否则
l 步骤二:上传“MySQL-5.5.46-1.linux2.6.x86_64.rpm-bundle.tar”,并解压
上传
解压
l 步骤三:安装service和client
l 步骤四:启动程序
l 步骤五:登录
2安装:yum
l 步骤一:检查是否有低版本的mysql,如果有卸载
l 步骤二:上传“MySQL-5.5.46-1.linux2.6.x86_64.rpm-bundle.tar”,并解压。删除其他,只需要service和client
l 步骤三:安装
l 步骤四:启动
l 步骤五:登录
3版本(之前)
l 步骤一:查询是否已经安装mysql
l 步骤二:如果已经安装卸载
l 步骤三:上传MySQL-5.6.25-1.el6.x86_64.rpm-bundle.tar
l 步骤四:解压
l 步骤五: 安装
l 步骤六:启动服务
l 重写修改密码