Ubuntu MySQL配置管理员密码

系统 Linux
设置root密码进入mysql 与配置 MySQL 的管理员密码:修改配置文件允许远程访问或控制 root@zack-desktop:~# sudo mysql -u root -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.

Ubuntu mysql是常用的开发系统,于是我学习研究了设置root密码进入Ubuntu mysql,在这里对大家详细介绍下设置root密码进入Ubuntu mysql系统应用,希望对大家有用。

设置root密码进入mysql

root@zack-desktop:~# sudo mysql -u root -pEnter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 45
Server version: 5.1.37-1ubuntu5 (Ubuntu)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

配置 Ubuntu MySQL 的管理员密码:

mysql> sudo mysqladmin -u root password newpassword或mysql> GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY "password01!";Query OK, 0 rows affected (0.00 sec)

修改配置文件允许远程访问或控制

1新建一个测试用的数据库
mysql> create database test;
Query OK, 1 row affected (0.00 sec)

2 给数据库添加test_root管理员用戶
mysql> GRANT ALL PRIVILEGES ON test.* TO test_root@"%" IDENTIFIED BY "123456";
Query OK, 0 rows affected (0.14 sec)

3打开配制文件
$sudo gedit /etc/mysql/my.cnf

my.conf
 
老的版本中 >skip-networking => # skip-networking 新的版本中 >bind-address=127.0.0.1 => bind-address= 你机器的IP

【编辑推荐】

  1. Ubuntu mysql安装服务器应该自动启动
  2. Ubuntu mysql编译乱码终于成功
  3. Ubuntu MySQL安装与配置文件
  4. 安装Ubuntu mysql解压配置编译
  5. Ubuntu mysql服务器安装布局
责任编辑:佚名 来源: CSDN
相关推荐

2010-12-08 11:30:48

VMMOperations

2020-04-02 08:00:36

管理工具配置

2019-08-30 10:28:18

网络配置管理工具

2010-01-04 10:57:29

Ubuntu TomC

2015-08-12 13:44:29

UbuntuChef

2009-07-18 08:42:01

2009-11-06 17:39:41

2010-08-10 09:13:52

Unix系统管理员Ubuntu

2011-07-08 09:16:47

cisco设备配置

2013-09-29 09:50:21

系统管理员Ubuntu JujuJuju

2014-05-05 16:54:31

IT管理员自动部署策略

2023-04-10 08:11:27

Jenkins数据库

2011-02-16 14:36:58

VMwareXenServer

2017-10-20 14:59:43

2012-02-14 11:05:32

2021-09-08 15:09:29

鸿蒙HarmonyOS应用

2010-09-16 12:50:36

2013-09-04 11:11:35

系统管理员脚本

2009-06-17 14:41:57

Hibernate查询

2022-05-06 12:04:24

Ansible管理工具
点赞
收藏

51CTO技术栈公众号