+ Post New Thread
Results 1 to 5 of 5
*nix Thread, MySQL Password Problem in Technical; The scenario... I was updating one of my Linux boxes (Debian Etch) and something broke - Apache/Perl/PHP/something and everything I ...
  1. #1

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,590
    Thank Post
    109
    Thanked 762 Times in 593 Posts
    Rep Power
    180

    MySQL Password Problem

    The scenario... I was updating one of my Linux boxes (Debian Etch) and something broke - Apache/Perl/PHP/something and everything I tried seemed to do nothing or make things worse.

    Anyway... I hadn't rebuilt this server for a while so I backed up the databases (in a sloppy manner using mysqldump without any switches ops: ).

    I rebuilt the server and quickly dumped the sql data back into the freshly installed MySQL forgetting about certain key authentication data held within the database.

    Anyway, it transpires that there is an account called debian-sys-main that I believe resides in MySQL and I need to change the password for this so that MySQL will start properly (at the moment I have to make it run without authentication :? ).

    Any ideas? Please help! I've tried alsorts!

  2. #2

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,590
    Thank Post
    109
    Thanked 762 Times in 593 Posts
    Rep Power
    180

    Re: MySQL Password Problem

    ^ Nudgey nudge nudge

  3. #3

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,802
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: MySQL Password Problem

    Change the password for the debian-sys-maint mysql user (phpmyadmin is easiest) and then put the new password (in plaintext) in the /etc/mysql/debian.cnf file.

  4. #4

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,590
    Thank Post
    109
    Thanked 762 Times in 593 Posts
    Rep Power
    180

    Re: MySQL Password Problem

    Quote Originally Posted by Geoff
    Change the password for the debian-sys-maint mysql user (phpmyadmin is easiest) and then put the new password (in plaintext) in the /etc/mysql/debian.cnf file.
    I tried changing the password using the command prompt (i.e. directly updating the DB) but it did not find the user. Adding the user didn't work either... I guess that this is because the DB is started useing the command

    Code:
    /usr/bin/mysqld_safe --skip-grant-tables &
    I know that this is bad practice but I had to get it running.

    BTW... I don't have phpmyadmin installed.

  5. #5

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,802
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: MySQL Password Problem

    Ubuntu 6.06 LTS here (not that it matters).

    Code:
    root@goliath:~# cat /etc/mysql/debian.cnf
    # Automatically generated for Debian scripts. DO NOT TOUCH!
    [client]
    host     = localhost
    user     = debian-sys-maint
    password = EO07Dx3bfeigAMMQ
    socket   = /var/run/mysqld/mysqld.sock
    [mysql_upgrade]
    host     = localhost
    user     = debian-sys-maint
    password = EO07Dx3bfeigAMMQ
    socket   = /var/run/mysqld/mysqld.sock
    and
    Code:
    root@goliath:~# mysql -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 70336 to server version: 5.0.22-Debian_0ubuntu6.06.3-log
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    
    mysql> select User,Password from mysql.user where User = 'debian-sys-maint';
    +------------------+------------------+
    | User             | Password         |
    +------------------+------------------+
    | debian-sys-maint | 5e705119345bc519 |
    +------------------+------------------+
    1 row in set (0.00 sec)
    
    mysql> quit
    Bye
    and finally
    Code:
    root@goliath:~# mysql -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 70354 to server version: 5.0.22-Debian_0ubuntu6.06.3-log
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    
    mysql> show grants for 'debian-sys-maint'@'localhost';
    +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Grants for debian-sys-maint@localhost                                                                                                                                                                                                                                                                                           |
    +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY PASSWORD '5e705119345bc519' WITH GRANT OPTION |
    +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    1 row in set (0.00 sec)
    
    mysql> quit
    Bye

SHARE:
+ Post New Thread

Similar Threads

  1. My Little Helpdesk and MySQL
    By WithoutMotive in forum Windows
    Replies: 7
    Last Post: 25th April 2008, 02:56 PM
  2. MYSQL Help
    By danIT in forum General Chat
    Replies: 2
    Last Post: 18th December 2007, 09:52 PM
  3. PHP/mysql website cms problem
    By netadmin in forum Web Development
    Replies: 3
    Last Post: 10th March 2007, 03:44 PM
  4. Java problem - Password Needed
    By mullet_man in forum Windows
    Replies: 5
    Last Post: 5th February 2007, 06:11 PM
  5. php MySql
    By iking in forum Books and Manuals
    Replies: 0
    Last Post: 11th July 2005, 03:35 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •