Страница 1 из 1

Проблема mysql!

Добавлено: 2007-08-02 16:18:44
o2x
Здравствуйте.
Возникла проблема.

Код: Выделить всё

13:12 [p0]root#mail:/var/db/mysql>ll
total 20538
-rw-rw----  1 mysql  mysql   5242880  2 авг 12:55 ib_logfile0
-rw-rw----  1 mysql  mysql   5242880 19 апр 07:47 ib_logfile1
-rw-rw----  1 mysql  mysql  10485760  2 авг 12:55 ibdata1
-rw-rw----  1 mysql  mysql         5  2 авг 12:55 mail.etc.net.ua.pid
drwx------  2 mysql  mysql      1536 19 апр 07:46 mysql/
drwx------  2 mysql  mysql       512  3 май 08:35 pureftpd/
drwx------  2 mysql  mysql      1024 19 апр 08:26 sacc/
drwx------  2 mysql  mysql       512 19 апр 07:46 test/
Пробую зайти в базу mysql:

Код: Выделить всё

13:12 [p0]root#mail:/var/db/mysql>mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9 to server version: 4.1.22

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mysql;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
mysql> quit;
Bye
Сбрасываю пароль

Код: Выделить всё

# /usr/local/etc/rc.d/mysql-server stop
13:13 [p0]root#mail:/var/db/mysql>ps ax | grep mysql
29801  p0  R+     0:00,00 grep mysql

# /usr/local/bin/mysqld_safe --skip-grant-tables &

13:15 [p0]root#mail:/var/db/mysql>mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.22

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+---------------------------+
| Tables_in_mysql           |
+---------------------------+
| columns_priv              |
| db                        |
| func                      |
| help_category             |
| help_keyword              |
| help_relation             |
| help_topic                |
| host                      |
| tables_priv               |
| time_zone                 |
| time_zone_leap_second     |
| time_zone_name            |
| time_zone_transition      |
| time_zone_transition_type |
| user                      |
+---------------------------+
15 rows in set (0.00 sec)

mysql> show databases;
+----------+
| Database |
+----------+
| mysql    |
| pureftpd |
| sacc     |
| test     |
+----------+
4 rows in set (0.00 sec)

mysql>  UPDATE user SET PASSWORD=('123321') WHERE USER='root';
Query OK, 2 rows affected (0.09 sec)
Rows matched: 2  Changed: 2  Warnings: 0

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

mysql> quit;
Bye
Перегружаю mysql

Код: Выделить всё

13:16 [p0]root#mail:/var/db/mysql>/usr/local/etc/rc.d/mysql-server restart
Stopping mysql.
mesg: /dev/ttyp0: Operation not permitted
Waiting for PIDS: 29825STOPPING server from pid file /var/db/mysql/mail.etc.net.ua.pid
070802 13:16:40  mysqld ended
.
Starting mysql.
mesg: /dev/ttyp0: Operation not permitted
[1]  + Окончено                      /usr/local/bin/mysqld_safe --skip-grant-tables
13:16 [p0]root#mail:/var/db/mysql>ps ax | grep mysql
29873  p0  S      0:00,02 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-file=/var/db/mysql/my.cnf --user=mysql --datadir=/var/db/mysql --pid-file=/var/
29893  p0  S      0:00,26 /usr/local/libexec/mysqld --defaults-extra-file=/var/db/mysql/my.cnf --basedir=/usr/local --datadir=/var/db/mysql --user=mysql --pi
29896  p0  RL+    0:00,00 grep mysql
Захожу под новым паролем:

Код: Выделить всё

13:16 [p0]root#mail:/var/db/mysql>mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Без пароля:

Код: Выделить всё

13:17 [p0]root#mail:/var/db/mysql>mysql -u root;
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.22

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+----------+
| Database |
+----------+
| test     |
+----------+
1 row in set (0.00 sec)

mysql> use mysql;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
mysql> exit
Bye
Вопрос. В чем проблема, почему не меняет пароль, и не видны базы?

Re: Проблема mysql!

Добавлено: 2007-08-02 16:24:29
dikens3
Вопрос. В чем проблема, почему не меняет пароль, и не видны базы?
Базы не видны, потому-что не хватает прав у подключившегося пользователя.

Такое впечатление, что ты подключаешься под рутом, но у него нет прав. :-(

Смотри конфиг mysql, скорее всего там прописан какой-то пользователь, и это не рут. Он автоматом под ним коннектится.

Re: Проблема mysql!

Добавлено: 2007-08-02 17:05:37
o2x
А в конфиге не прописано ничего..(

Re: Проблема mysql!

Добавлено: 2007-08-03 11:29:22
o2x
Проблему решил...
- Переустановка мускула;
- подмена баз;
- создание пользователей;
- выставление прав на соответствующие базы.
(