LINUX.ORG.RU
решено ФорумAdmin

MySQL: не могу зайти под новым пользователем

 


0

1
CREATE USER 'pbxuser'@'%' IDENTIFIED BY 'linuxorgru';
GRANT ALL ON pbxstat.* TO 'pbxuser'@'%';
FLUSH PRIVILEGES;



Пытаюсь зайти:

$ mysql -upbxuser -p
Enter password:
ERROR 1045 (28000): Access denied for user 'pbxuser'@'localhost' (using password: YES)


Под рутом (-u root) пускает. Что я не так делаю? Задача чтобы пускал под созданным юзером с этим паролем с любого хоста включая локалхост в заданную базу.

★★★★

http://stackoverflow.com/questions/10823854/using-for-host-when-creating-a-my...

Actually there is, 'localhost' is special in mysql, it means a connection over a unix socket (or named pipes on windows I believe) as opposed to a TCP/IP socket. using % as the host does not include 'localhost'

То есть если указать локалхост, то соединение идет через локальный сокет, а если через % то через локальный интерфейс.

Проверь возможно у тебя mysqld не случшает на сетевых интерфейсах

Jaberwock ★★★
()
Ответ на: комментарий от Harald

Тоже access denied.

Поборол вот так:

CREATE USER 'pbxuser'@'localhost' IDENTIFIED BY 'linuxorgru';
GRANT ALL ON pbxstat.* TO 'pbxuser'@'localhost';
FLUSH PRIVILEGES;


Т.е. создав того же юзера с тем хостом, который «видит» мускуль при попытке коннекта.

yu-boot ★★★★
() автор топика

и после рестарта mysql тоже ничего?

anonymous
()

УМВР

[root@stat ~]# mysql -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 828
Server version: 5.0.95-log Source distribution

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 USER 'pbxuser'@'%' IDENTIFIED BY 'linuxorgru';
Query OK, 0 rows affected (0.04 sec)

mysql> FLUSH PRIVILEGES;                       
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
[root@stat ~]# mysql -u pbxuser -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 829
Server version: 5.0.95-log Source distribution

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> exit

CentOS 5.11, версию mysql ты видишь

pinkbyte@web ~ $ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 82740
Server version: 5.6.22 Source distribution

Copyright (c) 2000, 2014, 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 USER 'pbxuser'@'%' IDENTIFIED BY 'linuxorgru';
Query OK, 0 rows affected (0,06 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0,01 sec)

mysql> exit
Bye

pinkbyte@web ~ $ mysql -u pbxuser -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 82796
Server version: 5.6.22 Source distribution

Copyright (c) 2000, 2014, 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> exit
Bye

Gentoo, версия посвежее.

Кури настройки my.cnf свои

Pinkbyte ★★★★★
()
Ответ на: комментарий от yu-boot

Значит локалхост обрабатывается по другому.

Еще раз посмотри по ссылке, что я кидал.

Проверил на локальной машине

create user 'testuser' identified by 'testpassword';

mysql -u testuser -h 127.0.0.1 -p

не работает

mysql -u utestuser -h 192.168.0.1 -p

работает

Jaberwock ★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.