ubuntu下mysql二进制包安装教程
1.下载对应二进制包
cd/usr/local/src sudowgethttp://dev.mysql.com/downloads/file/?id=465030
2.解压并放在/usr/local目录下改名为mysql
sudotarzxvfmysql-5.6.33-linux-glibc2.5-x86_64.tar.gz sudomvmysql-5.6.33-linux-glibc2.5-x86_64/usr/local/mysql
3.创建mysql分组和用户,更改mysql所属用户和用户组
groupaddmysql useradd-gmysqlmysql-s/bin/false sudochown-Rmysql:mysql/usr/local/mysql
4.初始化mysql
sudorm-rf/etc/my.cnf sudo./scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql
5.设置mysql启动命令
sudocp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysql sudochmod+x/etc/init.d/mysql
6.mysql启动
sudo/etc/init.d/mysql(start|stop|force-quit|restart|reload|status)
7.初始化mysql密码
cd/usr/local/mysql/bin sudo./mysqladmin-urootpasswordroot(密码)
8.通过自带mysqlclient连接数据库
cd/usr/local/mysql/bin sudo./mysql-uroot-p
9.查看mysql运行情况:
sudolsof-i:3306
10.扩展设置开机就启动
sudoapt-getinstallsysv-rc-conf sudosysv-rc-confphp-fpmon
11.配置外网访问
grantallprivilegeson*.*toqingpz@"%"identifiedby'234@#@4454*23'withgrantoption; flushprivileges;
以上所述是小编给大家介绍的ubuntu下mysql二进制包安装教程,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!