1. 問題描述:
在MySQL控制台下建立資料庫出現以下資訊:
mysql> CREATE DATABASE python;
ERROR 1044 (42000): Access denied for user ‘‘@‘localhost‘ to database ‘python‘
2. 解決方案:
執行以下命令進入控制台:(在MySQL bin檔案下)
mysql --user=root -p
輸入root使用者的密碼即可進入mysql控制台:
建立資料庫:
create database python;
顯示所有資料庫:
show databases;
如下:
www.linuxidc.com @www.linuxidc.com:~$ mysql --user=root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.17 MySQL Community Server (GPL)
Copyright (c) 2000, 2014,Oracleand/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.