时间:2021-07-01 10:21:17 帮助过:21人阅读
转到MySQL的bin目录下,在此处打开终端
- <code class="language-bash">mysqld --install
- </code>
- <code class="language-bash">mysqld --initialize --console
- </code>
随机生成的密码
- <code class="language-bash">QseEQHRdV9%z
- </code>
- <code class="language-bash">net start MySQL
- </code>
- <code class="language-bash">mysql -u root -p
- </code>
输入密码登录
- <code class="language-sql">alter user ‘root‘@‘localhost‘ identified by ‘123456‘;
- </code>
再次登录验证新密码
- <code>mysql
- C:\MySQL\mysql8
- </code>
- <code>%mysql%\bin
- </code>
配置完成之后,每当我们想要用命令行使用mysql时,只需要win+R,-->输入"cmd"打开命令行,之后输入登录sql语句即可。
my.ini
- <code class="language-ini">[mysqld]
- character-set-server=utf8mb4
- bind-address = 0.0.0.0
- port=3306
- default-storage-engine=INNODB
- [mysql]
- default-character-set=utf8mb4
- [client]
- default-character-set=utf8mb4
- </code>
使用免安装版的MySQL
标签:基本配置 use cal client lang win 全局 mysqld 输入密码