MySQL安装_MySQL
程序员文章站
2022-04-18 21:34:52
...
bitsCN.com
Install on Linux
采用二进制方式安装
# 建立用户和组shell>
groupadd mysql
shell>useradd -r -g mysql -d /home/mysql -s /bin/bash mysql
shell>
# 解压安装cd /usr/local
shell>tar zxvf
/path/to/mysql-VERSION-OS
.tar.gz
shell>ln -s
full-path-to-mysql-VERSION-OS
mysql
shell>cd mysql
shell>chown -R mysql .
shell>chgrp -R mysql .
shell>
# 初始化数据库scripts/mysql_install_db --user=mysql
shell>chown -R root .
shell>chown -R mysql data
# Next command is optional
shell>cp support-files/my-medium.cnf /etc/my.cnf
# Next command is optional
shell>cp support-files/mysql.server /etc/init.d/mysql.server
# 启动和停止
shell>bin/mysqld_safe --user=mysql &
shell>bin/mysqladmin -uroot shutdown
# 设置root密码
shell> mysql -u root
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('
mysql> newpwd
');SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('
mysql> newpwd
');SET PASSWORD FOR 'root'@'::1' = PASSWORD('
mysql> SET PASSWORD FOR 'root'@'newpwd
');host_name
' = PASSWORD('newpwd
');
bitsCN.com# 或者用update语句设置密码
shell>mysql -u root
mysql>UPDATE mysql.user SET Password = PASSWORD('
newpwd
')WHERE User = 'root';
mysql>FLUSH PRIVILEGES;
上一篇: MySQL prepare语句的SQL语法_MySQL
下一篇: Mysql备份与恢复
推荐阅读
-
ApowerREC屏幕录像机如何安装?ApowerREC屏幕录像机安装破解教程
-
木疙瘩动画制作软件如何使用?木疙瘩动画制作软件安装使用教程
-
阿里云服务器ECS上ubuntu安装nginx后默认站点页面打开错误,显示无法访问此网站
-
win7系统安装网银助手时提示您尚未正确安装错误的两种解决方法图文教程
-
IDEA搭建Springboot+SpringMVC+Mybatis+Mysql(详细、易懂)
-
win7安装Office提示1603/1902错误解决方法
-
PTC Arbortext Editor 7.1中文破解版安装许可激活图文详细教程
-
service pack3下载怎么安装(service pack3安装教程)
-
XMind 8 Update 7破解补丁中文授权一键注册安装破解教程(免序列号)
-
将MySQL数据库移植为PostgreSQL