お知らせ

  • 利用規約を守って投稿してください。また、よくある質問および投稿の手引きも参照してください。
  • メッセージの投稿にはアカウントが必要です。未登録の方は、ユーザ登録ページからアカウントを作成することができます。

#1 2012-05-17 18:50:54

roswell
メンバ
登録日: 2008-10-30

MySQL create user 文 でエラー SiteBarのインストール時に...

SiteBarのInstall を <http://www19.atwiki.jp/raphloig/?cmd=word&word=MySQL&type=normal&page=sitebar> サイトを参考に行っているのですが、
MySQLの設定のところで、

$mysql -u root -p で、password を打ち間違えていないのに、Access deniedになるので、
$mysql -u root@localhost -p で、'@localhost' をつけてあげると、mysql>プロンプトが出ます。
で、... データベースは、作成できるのですが、
create user sitebar@localhost;
すると、エラーになってしまいます。

何が原因か、ご教示いただけないでしょうか?

yama@roswell:~$ mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
yama@roswell:~$ mysql -u root@localhost -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 130
Server version: 5.1.62-0ubuntu0.11.10.1 (Ubuntu)

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> create database sitebar;
Query OK, 1 row affected (0.00 sec)

mysql> create user sitebar@localhost;
ERROR 1227 (42000): Access denied; you need the CREATE USER privilege for this operation
mysql>

オフライン

 

#2 2012-05-17 19:02:44

roswell
メンバ
登録日: 2008-10-30

Re: MySQL create user 文 でエラー SiteBarのインストール時に...

環境を書き忘れしたので、追加しておきます。

Welcome to Linux Mint 12 Lisa (GNU/Linux 3.0.0-12-generic i686)
yama@roswell:~$ mysql -V
mysql  Ver 14.14 Distrib 5.1.62, for debian-linux-gnu (i686) using readline 6.2

になります。

オフライン

 

#3 2012-05-17 23:44:52

epii
メンバ
登録日: 2008-12-11

Re: MySQL create user 文 でエラー SiteBarのインストール時に...

MySQL でアクセス先ホストを指定するには、
$ mysql -h HOST -u USER -p
などとします。
-u USER@HOST とするとユーザ名が "USER@HOST" という指定になってしまいます。
従って、なぜかは知りませんが、"root@localhost" という名前の root とは別のユーザが作られており、
そのユーザでログインして作業しているため、権限が足りないと怒られているようです。

root でログインできない理由はわかりませんが、
念の為パスワードを再設定して接続できないか確認してください。
http://dev.mysql.com/doc//refman/4.1/ja/resetting-permissions.html

オフライン

 

Board footer

Powered by FluxBB