MySQL - The Perfect Set Up Fedora Core 4

Discussion in 'Installation/Configuration' started by Gem, Jan 22, 2006.

  1. Gem

    Gem New Member

    Hello..

    I am in the process of setting up my server and am having a problem with the install for MySQL....I have followed the directions as posted and these are the errors that I am getting...

    ERROR: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
    060122 14:18:09 [ERROR] Aborting

    and when trying to set the password for root I am getting this error...

    error: 'Access denied for user 'root'@'localhost' (using password: NO)'

    MySQL starts and stops OK, and I have even started the whole install of Fedora over and am getting the same errors...I have goggled to see what I can do to fix the problem, but can not seem to find anything.

    Any help would be appreciated.

    Thanks :)
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    When exactly did you get this error. Please post the command that results in this error.
     
  3. Gem

    Gem New Member

    I got this error after typing in

    Code:
     /etc/init.d/mysqld start
    edits to add I am still getting the 1064 error

    Code:
     mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)'
     
    Last edited: Jan 22, 2006
  4. falko

    falko Super Moderator Howtoforge Staff

    What's the exact command you ran that gave you this error?
     
  5. Gem

    Gem New Member

    I used

    Code:
    mysqladmin -root password mypasswordhere
    I also tried

    Code:
    SET PASSWORD FOR root = PASSWORD("mypassword");
    and got the same error...
     
  6. falko

    falko Super Moderator Howtoforge Staff

  7. Gem

    Gem New Member

    I'm sorry, that was a typo on my part, I was using the comand

    Code:
    mysqladmin -u root password yourrootsqlpassword
    I even tried it again to make sure and I am getting the same error...
     
  8. falko

    falko Super Moderator Howtoforge Staff

  9. Gem

    Gem New Member

    I have read the thread that you posted and I am not sure that it really is going to help me. I have not tried to install ISPConfig yet because of the MySQL error that I am getting, plus the error that user was getting was:

    Code:
    ERROR:1045: Access denied for user:'root@localhost' (Using password:YES)
    ERROR: The provided MySQL password is wrong! The installation routine stops here!
    Mine is

    Code:
     mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)'
    I have not been able to create a password for root. I have tried to unistall MySQL to start over and it wont let me because of PHP, and that was before I got to the part of the install steps in the tut on PHP.

    I have even gone as far as starting completly over with a fresh install of Fedroa and am still getting the same error. I am at a loss...and it is getting so frusterating....got to love it though...*grin*

    Thanks for taking the time out and answering my questions...*S*
     
  10. falko

    falko Super Moderator Howtoforge Staff

    Is MySQL listening on localhost? Please post the output of
    Code:
    netstat -tap
    What's in /etc/hosts?
     
  11. Gem

    Gem New Member

    This is the output

    Code:
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
    tcp        0      0 *:imaps                     *:*                         LISTEN      3554/xinetd
    tcp        0      0 *:32769                     *:*                         LISTEN      1661/rpc.statd
    tcp        0      0 *:pop3s                     *:*                         LISTEN      3554/xinetd
    tcp        0      0 *:mysql                     *:*                         LISTEN      4730/mysqld
    tcp        0      0 *:pop3                      *:*                         LISTEN      3554/xinetd
    tcp        0      0 *:imap                      *:*                         LISTEN      3554/xinetd
    tcp        0      0 *:sunrpc                    *:*                         LISTEN      1643/portmap
    tcp        0      0 *:ftp                       *:*                         LISTEN      4060/proftpd: (acce
    tcp        0      0 localhost.localdomain:ipp   *:*                         LISTEN      1969/cupsd
    tcp        0      0 localhost.localdomain:5335  *:*                         LISTEN      1951/mDNSResponder
    tcp        0      0 *:smtp                      *:*                         LISTEN      3530/master
    tcp        0      0 xxx.xxx.x.xxx:53321         xx.xxx.xx.80:http           ESTABLISHED 3808/firefox-bin
    tcp        1      0 xxx.xxx.x.xxx:59227         xmlrpc.rhn.redhat.com:https CLOSE_WAIT  2650/python
    tcp        1      0 xxx.xxx.x.xxx:57897         xmlrpc.rhn.redhat.com:https CLOSE_WAIT  2650/python
    tcp        0      0 *:http                      *:*                         LISTEN      3850/httpd
    tcp        0      0 *:ssh                       *:*                         LISTEN      2017/sshd
    tcp        0      0 *:https                     *:*                         LISTEN      3850/httpd
    
    Code:
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1		localhost.localdomain localhost

    Thanks so much for your help, I really appreciate it. :)
     
  12. falko

    falko Super Moderator Howtoforge Staff

    Looks ok. Please restart MySQL. Do you have error messages in the logs in /var/log?

    Please try these two commands to see if it makes any difference:

    Code:
    mysqladmin -h localhost -u root password yourrootsqlpassword
    and

    Code:
    mysqladmin -h 127.0.0.1 -u root password yourrootsqlpassword
     
  13. Gem

    Gem New Member

    I tried both of those commands and got the same error:

    Code:
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)'
    and

    Code:
    mysqladmin: connect to server at '127.0.0.1' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)'
    I looked in the /var/log/mysqld.log and I am not seeing any errors.
     
  14. Gem

    Gem New Member

    Looking around the web I came across a site that said to try and change the root password by installing a database by typing the comand:

    Code:
    mysql_install_db
    and then changing the password...

    I tried this and got the following error after trying the istall comand and it would not let me any farther....:

    Code:
    Installing all prepared tables
    Fill help tables
    ERROR: 1064  You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
    060124 19:26:56 [ERROR] Aborting
    
    060124 19:26:56 [Note] /usr/libexec/mysqld: Shutdown complete
    Could this be the problem why I can not change the root pw? I have tried goggling to see how to fix this error and either I am not seeing it or I am just not understanding how to fix it....
     
  15. Gem

    Gem New Member

    I got it working. Thanks for your help...*S*
     
  16. rupsshar

    rupsshar New Member

    help with mysql configuration on fc4

    Gem,

    I have run into the same problem.
    Can you tell me how you fixed it?

    I have fedora core 4, which comes with MySql 4.1.x version.
    This was working fine until I upgraded it to 5.0.19

    I can start the mysqld deamon without any errors, but cannot create a root password.

    /usr/bin/mysqladmin -h localhost -u root password mypassword
    /usr/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)'
     
  17. falko

    falko Super Moderator Howtoforge Staff

    It seems you don't have a password yet, so try this:

    Code:
    mysql -u root
     
  18. rajayoganand

    rajayoganand New Member

    MySQL password problem

    Dear all,

    check the following
    1. mysql Server is running?!!!
    If running give the following command as root
    # mysql

    if it is showing Error like the following It meens the sql have root password set.
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    Other wise it will come to mysql prompt like ....
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql>

    If the password is NOT set for user root you can do this simply by giving the following in command prompt of linux

    # mysqladmin -u root password 'mynewpassword'

    if you forget password you can do the following

    # Take down the mysqld server by sending a kill (not kill -9) to the mysqld server. The pid is stored in a `.pid' file, which is normally in the MySQL database directory:

    shell> kill `cat /mysql-data-directory/hostname.pid`

    You must be either the Unix root user or the same user mysqld runs as to do this.
    # Restart mysqld with the --skip-grant-tables option.
    # Set a new password with the mysqladmin password command:

    shell> mysqladmin -u root password 'mynewpassword'

    # Now you can either stop mysqld and restart it normally, or just load the privilege tables with:

    shell> mysqladmin -h hostname flush-privileges

    # After this, you should be able to connect using the new password.


    Alternatively, you can set the new password using the mysql client:

    1. Take down and restart mysqld with the --skip-grant-tables option as described above.
    2. Connect to the mysqld server with:

    shell> mysql -u root mysql

    3. Issue the following commands in the mysql client:

    mysql> UPDATE user SET Password=PASSWORD('mynewpassword')
    -> WHERE User='root';
    mysql> FLUSH PRIVILEGES;

    4. After this, you should be able to connect using the new password.
    5. You can now stop mysqld and restart it normally.


    Thank you
    Regards.
    help for all.....
    rajayoganand
    :)
     

Share This Page