Find the answer to your Linux question:
Results 1 to 6 of 6
LAMP environment is installed in my redhat 5.4 server for an application software.I have kept the database at /var/lib/mysql/ecourtsdb and content of the application at /var/www/html.Application was accessible but after ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2009
    Location
    india
    Posts
    57

    Problem in MYSQL in LAMP environment


    LAMP environment is installed in my redhat 5.4 server for an application software.I have kept the database at /var/lib/mysql/ecourtsdb and content of the application at /var/www/html.Application was accessible but after using this command
    [root@localhost ~]# /usr/bin/mysqladmin -u root password redhat
    [root@localhost ~]#

    the application was showing in the web browser Access denied for user 'apache'@'localhost' (using password: NO)

    and in the command promt its showing
    [root@localhost ~]# /usr/bin/mysqladmin -u root password redhat
    /usr/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)'

    [root@localhost ~]#/usr/bin/mysqladmin -u apache password redhat
    /usr/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'apache'@'localhost' (using password: NO)'

    I think apache can not access the mysql.thats why this is showing in the browser.

    Need help.

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,759
    /usr/bin/mysqladmin -u root password redhat
    /usr/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)
    Read the manual / use Google.

    Code:
    mysqladmin --help
    
      -p, --password[=name] 
                          Password to use when connecting to server. If password is
                          not given it's asked from the tty.


    Code:
    mysqladmin -u root -p password
    OR

    Code:
    mysqladmin -u root -p

  3. #3
    Just Joined!
    Join Date
    Mar 2009
    Location
    india
    Posts
    57
    Code:
    [root@localhost ~]# mysqladmin -u root -p redhat
    Enter password: 
    mysqladmin: Unknown command: 'redhat'
    this is showing
    i used the below mentioned command to change the password of root but was not working

    Code:
    [root@localhost ~]# mysqladmin -u root -p redhat password nic123
    Enter password: 
    mysqladmin: Unknown command: 'redhat'

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Mar 2009
    Location
    india
    Posts
    57
    Code:
    [root@localhost ~]# mysqladmin -u root -predhat password nic123
    [root@localhost ~]# mysql -u root -p
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 24
    Server version: 5.0.45 Source distribution
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    
    mysql>
    this command worked.

  6. #5
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,759
    Nowhere did you state you were trying to change the MySQL root password using the mysqladmin command.

    Google: mysqladmin change password

    First Link

    Code:
    mysqladmin -u root -p'abc' password '123456'

  7. #6
    Just Joined!
    Join Date
    Mar 2009
    Location
    india
    Posts
    57
    before assigning password for mysql(mysqladmin -u root password newpassword )for the first time,mysql db was accessible from the web browser.As the problem occurred after assigning the password i was trying to change the password.
    Although the problem is still there after changing the password.

Posting Permissions

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