本文主要是介绍how to install Mysql client and desktop version/workbench,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
6.1 MySQL数据库
MySQL下载与安装
进入mysql官网,找到社区版MYSQL下载地址:https://dev.mysql.com/downloads/
second one.zip for download
使用管理员身份打开cmd,并cd到bin目录下,进行初始化数据库存储文件:mysqld.exe --initialize --console
问题:安装的时候提示data目录已经存在——data目录是存储数据的目录
解决方式:1 删除data目录。2 初始化数据库存储文件时,制定一个配置文件其中data目录制定一个空目录。
对于初学者建议直接删除data目录:
删除data目录后,重新执行命令如下图:mysqld.exe --initialize --console
(A temporary password is generated for root@localhost: ojEOpe9#eXX-)
注意:其结果中生成了root账户的默认密码,需要记住后使用。
创建mysql的Windows服务:
mysqld.exe -install
删除mysql服务:
mysqld.exe -remove mysql
启动服务命令:
net start mysql
停止服务命令:
net stop mysql
登录和修改密码
上面安装时创建的root用户密码是零时密码,需要在有效期内修改。过期会导致问题。
cmd下等mysql: mysql -uroot -ppassword
mysql -uroot -p16tfDtkgQ5#X
mysql -uroot -pojEOpe9#eXX-
登录后修改密码:ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘自己想要设置的新密码’;
alter user ‘root’@‘localhost’ identified by ‘root’;
(set user name and password the same as root)
alter user ‘root’@‘localhost’ identified by ‘’;
PS1: we need to install VC++ 2019
https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170
C++package
- how to change directory on CMD run as administrator
first change directory to specific driver disk >> secondly cd to specific folders under the specified driver disk
C:\>cd Windows\System32C:\Windows\System32>cd ..C:\Windows>
C:\Windows>D:C:\Windows\System32>D:D:\>cd D:\LeStoreDownloadD:\LeStoreDownload>
PS2: coodinate the path for easily logging on mysql anywhere of PC
C:\Windows\System32>mysql -u root -proot
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.4.0 MySQL Community Server - GPLCopyright (c) 2000, 2024, Oracle and/or its affiliates.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.
P3) workbench installation or uninstallation/removal are the same exe fil
VC++ 2019 over needed to installed as well as above shown
这篇关于how to install Mysql client and desktop version/workbench的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!