เราสามารถตั้งค่า password ของ root ได้ดังนี้
$ mysql -u root mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 146 to server version: 5.0.26-standard Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer. mysql> SET PASSWORD FOR root@localhost=PASSWORD(’newpassword’); Query OK, 0 rows affected (0.06 sec) mysql>
จากตัวอย่างข้างต้น เราได้ตั้ง password ของ root เป็น newpassword หากตั้งค่าไม่ได้ให้เพิ่ม -p เข้าไปเพื่อให้สามารถใส่ password ได้ ดังนี้
$ mysql -u root mysql ERROR 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: NO) $ mysql -u root -p mysql Enter password: Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 146 to server version: 5.0.26-standard Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer. mysql>
ที่มา: NetAdminTools



Recent comments
2 weeks 1 day ago
6 weeks 3 days ago
6 weeks 6 days ago
19 weeks 13 hours ago
24 weeks 1 day ago
38 weeks 4 days ago
43 weeks 16 hours ago
43 weeks 6 days ago
49 weeks 9 hours ago
51 weeks 3 days ago