Q&A
前提・実現したいこと
MySQLでDATABASE の名前の変更をしたいのでそのやり方を教えてください。
RENAMEで実施したがエラーになります。
どうぞよろしくお願いします。
発生している問題・エラーメッセージ
#DATABASEとUSERと同じにしてしまったので変更したいです。。。 mysql> CREATE DATABASE scrapingman DEFAULT CHARACTER SET utf8; Query OK, 1 row affected (0.00 sec) mysql> CREATE USER 'scrapingman' IDENTIFIED BY '******'; Query OK, 0 rows affected (0.03 sec) mysql> GRANT ALL ON scrapingdata.* TO scrapingman; Query OK, 0 rows affected (0.00 sec) mysql> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | scrapingman | | sys | +--------------------+ 5 rows in set (0.02 sec) #RENAMEで実行したがエラーに。。。 mysql> rename scrapingman to scrapingdata; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'scrapingman to scrapingdata' at line 1 mysql> RENAME DATABASE scrapingman to scrapingdata; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATABASE scrapingman to scrapingdata' at line 1
回答1件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
2018/10/07 00:51