在OSX 终端提示符下,您输入mysql -u root
以实际启动连接到服务器的命令行客户端。
shell>
代表您的 shell 提示符实际的样子。
在命令行提示符下键入后,您无需输入此内容。mysql
这是一个示例会话:
shell> mysql -u root
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd');
mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('newpwd');
mysql> SET PASSWORD FOR 'root'@'::1' = PASSWORD('newpwd');
mysql> SET PASSWORD FOR 'root'@'host_name' = PASSWORD('newpwd');
注意:您可能需要在前面shell> mysql -u root
加上shell> sudo mysql -u root
我的 shell 提示符被定制为最后[jhr@Blackintosh] [/usr/local/mysql-5.5.25a-osx10.6-x86_64/bin]
带有 a \n
,因此./mysql -u root
它在下一行输入。其余的是该命令的输出应该是什么。shell 提示符替换为mysql
程序提示符的提示符。
这是我的 shell 输出的样子
[jhr@Blackintosh] [/usr/local/mysql-5.5.25a-osx10.6-x86_64/bin]
./mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.5.25a MySQL Community Server (GPL)
Copyright (c) 2000, 2011, 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>