我尝试在笔记本电脑上安装的操作系统以下
Mint version 19,
Code name : Tara,
PackageBase : Ubuntu Bionic
Cinnamon (64-bit)
我已经使用以下命令安装了mysql-server:
xxxxxxx:~$ sudo apt-get install mysql-server
在此安装过程中,未提示我输入任何root密码。 要查看安装是否成功,我运行了以下命令:
xxxxxxxxxx:~$ mysql -V
mysql Ver 14.14 Distrib 5.7.23, for Linux (x86_64) using EditLine wrapper
xxxxxxxxxx:~$ sudo service mysql status
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2018-09-30 21:59:42 EDT; 9s ago
Main PID: 3518 (mysqld)
Tasks: 27 (limit: 4915)
CGroup: /system.slice/mysql.service
└─3518 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid
Sep 30 21:59:41 globallogic systemd[1]: Starting MySQL Community Server...
Sep 30 21:59:42 globallogic systemd[1]: Started MySQL Community Server.
由于没有提示我设置任何root密码,所以我想到了设置root密码。
xxxxxxxx:~$ mysqladmin -u root password
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost''
xxxxxxxx:~$ sudo mysqladmin -u root password
New password:
Confirm new password:
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
1。为什么不能以root用户身份登录不能使用“ mysqladmin”命令?
2。如何修复mysqladmin设置root密码的警告?如果决定使用该密码,将来是否可以在mysql工作台中使用该密码?
设置了root密码后(假设是正确的设置方式),我已经安装了mysql-workbench
xxxxxxx:~$ sudo apt-get install mysql-workbench
当我启动mysql workbench时,我无法连接到 使用主机名:localhost和端口:3306的用户:root和使用mysqladmin命令设置的密码。
我还尝试使用主机名:127.0.0.1,但这也不起作用。
3。如何解决mysql-workbench问题?
我在互联网上寻找答案,并尝试了多种解决方案,但没有一个奏效。
希望在这里获得更清晰的答案。
答案 0 :(得分:0)
注意:已安装 mysql工作台版本6.3 和 mysql服务器版本5.7
在安装之前,我清理了Linux计算机上的所有mysql文件/引用。
sudo apt-get remove --purge mysql* sudo apt-get purge mysql* sudo apt-get autoremove sudo apt-get autoclean sudo apt-get remove dbconfig-mysql
以下步骤对我来说效果很好-
转到位于https://dev.mysql.com/downloads/repo/apt/的MySQL APT存储库的下载页面,并下载 mysql-apt-config_0.8.10-1_all.deb
确保所有内容都是最新的。
xxxxxxxxx:~/Downloads$ sudo apt-get update
xxxxxxxxx:~/Downloads$ sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb Selecting previously unselected package mysql-apt-config. (Reading database ... 273762 files and directories currently installed.) Preparing to unpack mysql-apt-config_0.8.10-1_all.deb ... Unpacking mysql-apt-config (0.8.10-1) ... Setting up mysql-apt-config (0.8.10-1) ... Warning: apt-key should not be used in scripts (called from postinst maintainerscript of the package mysql-apt-config) OK
在此步骤中,选择了mysql服务器版本5.7
xxxxxxxxx:~/Downloads$ sudo apt-get install mysql-server
在此步骤中,系统提示我设置root密码。最终将根密码设置为“ pa $$ word”
xxxxxxxxx:~/Downloads$ sudo service mysql status ● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2018-10-01 15:31:19 EDT; 29s ago Main PID: 23029 (mysqld) Tasks: 27 (limit: 4915) CGroup: /system.slice/mysql.service └─23029 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid Oct 01 15:31:18 systemd[1]: Starting MySQL Community Server... Oct 01 15:31:19 systemd[1]: Started MySQL Community Server.
xxxxxxxx:~/Downloads$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.23 MySQL Community Server (GPL) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec) mysql> quit Bye
xxxxxxxxxxx:〜/下载$ sudo apt-get install mysql-workbench
从Linux Mint 19的开始菜单启动mysql工作台。 在此,服务器连接具有参数,例如主机名:127.0.0.1,端口:3306,用户名:root,密码:pa $$ word 。经过测试的连接-成功。
双击连接即可启动实例。