Reset the MySQL Root Password

原文:Reset the MySQL Root Password

Reset the MySQL Root Password

By default, the MySQL installation that ships with XAMPP has an empty root password. This is a serioussecurity risk, especially if you plan to use XAMPP in production scenarios.To change the MySQL root password, follow these steps:
1.Ensure that the MySQL server is running.
2.Open a new Linux terminal.
3.Use the mysqladmin command-line utility to alter the MySQL password, using the following syntax:

mysqladmin --user=root password "newpassword"

The mysqladmin command-line utility is located within the bin/ subdirectory of the XAMPP installationdirectory, typically /opt/lampp.For example, to change the MySQL root password from its default empty value to the password gue55me,you would execute:

/opt/lampp/bin/mysqladmin --user=root password "gue55me"

Or, if a password has already been previously set and you’d like to change it to a new one, you can use thefollowing syntax:

mysqladmin --user=root --password=oldpassword password "newpassword"

For example, to change the root password from 12345 to gue55me, you would execute:

/opt/lampp/bin/mysqladmin --user=root --password=12345 password "gue55me"

4.Test that your password change has been accepted, by attempting to connect to the MySQL server usingthe mysql command-line client in the same directory.
For example, you could use the command below toconnect to the server and return the results of a calculation:

/opt/lampp/bin/mysql --user=root --password=gue55me -e "SELECT 1+1"
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值