23. juli 2001 - 20:53Der er
35 kommentarer og 1 løsning
Wrong password for database user
Hihi
Jeg har et prob. med MySQL under Linux, Installation er ikke noget prob., men så laver man en database og opretter en user til den db. hvis man så bruger den user man lige har lavet, siger den wrong password, hmm.
Og nej det er ikke fordi min caps lock hænger, jeg har prøvet at lave flere ny users, den siger det samme om alle.
Skal man aktivere users af en db? Eller give dem W/R access? I så fald hvordan gør man det?
mysql> GRANT all privileges ON *.* TO bbuser@% IDENTIFIED BY \'bbpass\'; ERROR 1064: You have an error in your SQL syntax near \'% IDENTIFIED BY \'bbpass\'\' at line 1 mysql>
# -------------------------------------------------------- # # Table structure for table \'admins\' #
CREATE TABLE admins ( user varchar(32) NOT NULL, forum mediumint(9) NOT NULL, KEY user (user), KEY forum (forum) );
# -------------------------------------------------------- # # Table structure for table \'create_keys\' #
CREATE TABLE create_keys ( ckey varchar(32) NOT NULL, user varchar(32) NOT NULL, UNIQUE user (user) );
# -------------------------------------------------------- # # Table structure for table \'forums\' #
CREATE TABLE forums ( num mediumint(9) NOT NULL auto_increment, title varchar(64) NOT NULL, description text NOT NULL, moderated tinyint(4) NOT NULL, creation_date datetime DEFAULT \'0000-00-00 00:00:00\' NOT NULL, public int(4) NOT NULL, moderated_sub int(4) NOT NULL, UNIQUE num (num) );
# -------------------------------------------------------- # # Table structure for table \'messages\' #
CREATE TABLE messages ( num bigint(20) NOT NULL auto_increment, creation_date timestamp(14), forum mediumint(9) NOT NULL, subject varchar(128) NOT NULL, user varchar(32) NOT NULL, message text NOT NULL, reply bigint(20), moderated_ok tinyint(4) NOT NULL, UNIQUE num (num) );
# -------------------------------------------------------- # # Table structure for table \'subscribers\' #
CREATE TABLE subscribers ( user varchar(32) NOT NULL, forum mediumint(9) NOT NULL, subscription_date datetime DEFAULT \'0000-00-00 00:00:00\' NOT NULL, moderated_ok int(4) DEFAULT \'1\' NOT NULL, KEY user (user), KEY forum (forum) );
# -------------------------------------------------------- # # Table structure for table \'users\' #
CREATE TABLE users ( user varchar(32) NOT NULL, pass varchar(32) NOT NULL, name varchar(32), firstname varchar(32), email varchar(128), creation_date datetime DEFAULT \'0000-00-00 00:00:00\' NOT NULL, invisible tinyint(4) NOT NULL, UNIQUE user (user) );
mysql> SHOW GRANTS FOR \'bbuser\'@\'%\'; +---------------------------------------------------------------------------------------+ | Grants for bbuser@% | +---------------------------------------------------------------------------------------+ | GRANT ALL PRIVILEGES ON *.* TO \'bbuser\'@\'%\' IDENTIFIED BY PASSWORD \'6b632e690de2ecac\' | +---------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
GRANT all privileges ON *.* TO \'bbuser@localhost\' IDENTIFIED BY \'bbpass\';Query OK, 0 rows affected (0.13 sec)
SHOW GRANTS FOR \'bbuser@localhost\'; +-------------------------------------------------------------------------------------------------+ | Grants for bbuser@localhost@% | +-------------------------------------------------------------------------------------------------+ | GRANT ALL PRIVILEGES ON *.* TO \'bbuser@localhost\'@\'%\' IDENTIFIED BY PASSWORD \'6b632e690de2ecac\' | +-------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
mysql -p -u bbuser bbforums < MYSQL_STRUCTURE Enter password: *password hidden* ERROR 1045: Access denied for user: \'bbuser@localhost\' (Using password: YES)
GRANT all privileges ON *.* TO \'bbuser\'@\'localhost\' IDENTIFIED BY \'bbpass\'; Query OK, 0 rows affected (0.02 sec)
SHOW GRANTS FOR \'bbuser\'@\'localhost\'; +-----------------------------------------------------------------------------------------------+ | Grants for bbuser@localhost | +-----------------------------------------------------------------------------------------------+ | GRANT ALL PRIVILEGES ON *.* TO \'bbuser\'@\'localhost\' IDENTIFIED BY PASSWORD \'6b632e690de2ecac\' | +-----------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
mysql -p -u bbuser bbforums < MYSQL_STRUCTURE Enter Password: *hidden password*
Der er dog stadig et eller andet mystisk, men mysql virker nu.
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.