安装mysql后必须要做的一件事
2024-09-07 07:45:27
Step 1. 检查默认账户和密码
$cat /etc/mysql/debian.cnf # 在ubuntu下查看默认账户名和密码
会看到
[client]
host = localhost
user = debian-sys-maint
password = ****************
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = debian-sys-maint
password = ****************
socket = /var/run/mysqld/mysqld.sock
Step 2. 使用默认账户登录并修改root密码
$mysql -u debian-sys-maint -p
Enter password:
mysql> use mysql;
mysql> update user set authentication_string=PASSWORD('密码') and plugin='mysql_native_password' where User='root'; # 注意此处PASSWORD() 函数不可少
mysql> flush privileges;
mysql> exit;
$ sudo service mysql restart # 重启mysql服务
Step 3. 使用root登录
$ mysql -u root -p
Enter password:
mysql>
最新文章
- C语言--乱写C语言
- mysql存储过程中 乱码问题解决办法
- oracle在cmd中启动数据库实例
- csuoj 1116: Kingdoms
- ps -C
- jmeter 建立一个网络服务的测试计划
- (09)odoo工作流
- hadoop2.2.0 MapReduce求和并排序
- Windbg找出死锁
- 添加一个Application Framework Service
- 百度短信API开发
- 每日一练ACM
- springMVC4(7)模型视图方法源代码综合分析
- (zhuan) 资源|TensorFlow初学者必须了解的55个经典案例
- 【C#】 基于ArcFace 2.0—视频人脸识别Demo
- 查看ubuntu版本号
- 基于jCOM搭建Java-微软信息桥梁(下)
- xshell sftp可用命令,sftp: cannot open d: to write![解决]
- HDU 2138 Miller-Rabin 模板题
- linux initcall 介绍 (转自http://blog.csdn.net/fenzhikeji/article/details/6860143)
热门文章
- 【翻译】--19C Oracle 安装指导
- Computer Vision_18_Image Stitching:Automatic Panoramic Image Stitching using Invariant Features——2007
- word生成目录的pdf
- Linux 02 Linux基本概念及操作
- Ubuntu系统---系统驱动丢失、Kernel内核卸载、禁止更新
- 成功解决 AttributeError: module 'tensorflow.python.keras.backend' has no attribute 'get_graph'
- [HNOI2007]分裂游戏 SG打表博弈
- 如何用pycharm 控制远程服务器来跑代码!!!!!!!!!!!!非常牛逼
- express框架初步
- 洛谷P2114 起床困难综合症【位运算】【贪心】