Новости
Документация
Download
Webboard
Поиск
FAQ/ЧаВо
Обратная связь




MySQL.RU - Webboard



Вернуться
Mysql 4.1.9 WinXP --old_passwords и cp1251 (ramboza) 20/01/2005 - 00:24:17
      Re: Mysql 4.1.9 WinXP --old_passwords и cp1251 (PoDoNoK) 20/01/2005 - 14:57:21
      Re: Mysql 4.1.9 WinXP --old_passwords и cp1251 (ramboza) 20/01/2005 - 15:37:03
      Re: Mysql 4.1.9 WinXP --old_passwords и cp1251 (ramboza) 20/01/2005 - 22:36:06
      Re: Mysql 4.1.9 WinXP --old_passwords и cp1251 (PoDoNoK) 21/01/2005 - 15:46:58
      Re: Mysql 4.1.9 WinXP --old_passwords и cp1251 (PoDoNoK) 22/01/2005 - 12:50:11
      Re: Mysql 4.1.9 WinXP --old_passwords и cp1251 (Edvard) 09/02/2005 - 20:20:27
      Re: Mysql 4.1.9 WinXP --old_passwords и cp1251 (Андрей) 13/07/2006 - 11:54:55

> Original message text:
> From: ramboza - 20/01/2005 - 00:24:17
> Subject:Mysql 4.1.9 WinXP --old_passwords и cp1251
> -----------------
> Здравствуйте, долго искал по форуму решение обеих своих проблем, но так его и не нашел.
> 1) В версии 4.1.9 используется другой метод авторизации, я в курсе, что нужно использовать ключ --old-passwords
> Но вот где его использовать? Запуск mysqld происходит через сервис, пробовал вписать в start parameters - все равно при выводе show variables; переменная
> OLD_PASSWORDS | OFF
>
> P.S
> Очень геморойно при создании очередного пользователя устанавливать ему пароль через
> set password for user@localhost=OLD_PASSWORD('pass')
>
> 2)Пытался решить проблему с кодировкой cp1251, выкладываю кусок my.ini:
>
> [client]
>
> port=3306
>
> [mysqld]
>
> old_passwords=ON (обратите внимание, не работает)
> basedir="C:/mysql/"
> datadir="C:/mysql/Data/"
>
> character-sets-dir="c:/mysql/share/charsets/"
> language=C:/mysql/share/russian
> default-character-set=cp1251
>
> ...
>
> на что опять же show variables; гласит следующее:
>
> character_set_client | latin1
> character_set_connection | latin1
> character_set_database | cp1251
> character_set_results | latin1
> character_set_server | cp1251
> character_set_system | utf8 (!!!)
> character_sets_dir | C:\mysql\share\charsets/
>
> каким образом системная кодировка оказалась utf8 до сих пор не пойму, одни абрыкадабры в консоле...
>
> Из-под php скрипта первый запрос делаю
> $query_code= "SET character set cp1251";
>
> не помогает, в базе пояляются (????????) вместо русского текста.
>
>
>
>
>


From: PoDoNoK - 20/01/2005 - 14:57:21
Subject:Mysql 4.1.9 WinXP --old_passwords и cp1251
-----------------
Только что я проделал тоже самое, кароче вот что тебе нужно сделать:

A.2.3 Client does not support authentication protocol
MySQL 4.1 and up uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older clients. If you upgrade the server to 4.1, attempts to connect to it with an older client may fail with the following message:

shell> mysql
Client does not support authentication protocol requested
by server; consider upgrading MySQL client

To solve this problem, you should use one of the following approaches:

Upgrade all client programs to use a 4.1.1 or newer client library.
When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password.
Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program. This can be done using the SET PASSWORD statement and the OLD_PASSWORD() function:
mysql> SET PASSWORD FOR
-> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

Alternatively, use UPDATE and FLUSH PRIVILEGES:
mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')
-> WHERE Host = 'some_host' AND User = 'some_user';
mysql> FLUSH PRIVILEGES;

Substitute the password you want to use for ``newpwd'' in the preceding examples. MySQL cannot tell you what the original password was, so you'll need to pick a new one.
Tell the server to use the older password hashing algorithm:
Start mysqld with the --old-passwords option.
Assign an old-format password to each account that has had its password updated to the longer 4.1 format. You can identify these accounts with the following query:
mysql> SELECT Host, User, Password FROM mysql.user
-> WHERE LENGTH(Password) > 16;

For each account record displayed by the query, use the Host and User values and assign a password using the OLD_PASSWORD() function and either SET PASSWORD or UPDATE, as described earlier.
For additional background on password hashing and authentication, see section 5.5.9 Password Hashing in MySQL 4.1.

С кодировкой разрешилосс всё просто, я поставил в my.ini не латин, а cp1251 или поставь кодировку в которой у тебя.

Да, я в самом начале запускал скрипт. Всё описанно тут:
2.10.7 Upgrading the Grant Tables

Some releases introduce changes to the structure of the grant tables (the tables in the mysql database) to add new privileges or features. To make sure that your grant tables are current when you update to a new version of MySQL, you should update your grant tables as well.

On Unix or Unix-like systems, update the grant tables by running the mysql_fix_privilege_tables script:

shell> mysql_fix_privilege_tables

You must run this script while the server is running. It attempts to connect to the server running on the local host as root. If your root account requires a password, indicate the password on the command line. For MySQL 4.1 and up, specify the password like this:

shell> mysql_fix_privilege_tables --password=root_password

Prior to MySQL 4.1, specify the password like this:

shell> mysql_fix_privilege_tables root_password

The mysql_fix_privilege_tables script performs any actions necessary to convert your grant tables to the current format. You might see some Duplicate column name warnings as it runs; you can ignore them.

After running the script, stop the server and restart it.

On Windows systems, there isn't an easy way to update the grant tables until MySQL 4.0.15. From version 4.0.15 on, MySQL distributions include a `mysql_fix_privilege_tables.sql' SQL script that you can run using the mysql client. If your MySQL installation is located at `C:\mysql', the commands look like this:

C:\> C:\mysql\bin\mysql -u root -p mysql
mysql> SOURCE C:\mysql\scripts\mysql_fix_privilege_tables.sql

If your installation is located in some other directory, adjust the pathnames appropriately.

The mysql command will prompt you for the root password; enter it when prompted.

As with the Unix procedure, you might see some Duplicate column name warnings as mysql processes the statements in the `mysql_fix_privilege_tables.sql' script; you can ignore them.

After running the script, stop the server and restart it.

If you are upgrading to MySQL 5.0.1 or later, the grant table upgrade procedure just described will add view-related columns for the CREATE VIEW and SHOW VIEW privileges. These privileges exist at the global and database levels. Their initial values are assigned as follows:

In MySQL 5.0.2 or later, mysql_fix_privilege_tables copies the Create_priv value in the user table to the Create_view_priv and Show_view_priv columns.
In 5.0.1, the view-related privileges are not enabled for any accounts, so you cannot immediately use GRANT to give them to accounts that should have them. To deal with this, first connect to the server as root and issue the following statements to give the privileges to the root accounts manually with UPDATE:

mysql> UPDATE mysql.user SET Show_view_priv = 'Y', Create_view_priv = 'Y'
-> WHERE User = 'root';
mysql> FLUSH PRIVILEGES;

After this, root can use GRANT to give the view privileges to other accounts. Note: You should issue the statements just shown, GRANT ALL will not work at the global and database levels, because GRANT ALL requires that you actually possess all privileges.

КАРОЧЕ ВСЁ В МАНУЛЕ ЕСТЬ!!!!!!!!!!


[Это сообщение - спам!]

Последние сообщения из форума

Уважаемые посетители форума MySQL.RU!
Убедительная просьба, прежде чем задавать свой вопрос в этом форуме, обратите внимание на разделы:
- ответы на наиболее часто задаваемые вопросы - FAQ
- раздел документация
- раздел поиск по сообщениям форума и документации
Также, старайтесь наиболее подробно указывать свою ситуацию (версию операционной системы, версию MySQL, версию программного обеспечения, по которому возникает вопрос, текст возникающих ошибок, и др.)
Помните, чем конкретнее Вы опишете ситуацию, тем больше шансов получить реальную помощь.
 Имя:
 E-mail:
 Тема:
 Текст:
Код подтверждения отправки: Code
29126



РЕКЛАМА НА САЙТЕ
  Создание сайтов | |