mysqladmin: connect to server at 'localhost' failed - MySQL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajbala
    New Member
    • Oct 2006
    • 58

    mysqladmin: connect to server at 'localhost' failed - MySQL

    hi all,

    I got the error like
    [sait6@localhost treestructure]$ mysqladmin -h localhost -u root -p create bedrock
    Enter password: ******
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localho st' (using password: YES)'

    [sait6@localhost treestructure]$ mysqladmin --no-defaults -u root ver
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localho st' (using password: NO)'


    and when i type mysql and start to change some password i got

    mysql> INSERT INTO user (Host,User,Pass word)
    -> VALUES('%','sai t6','sait123');
    ERROR 1046 (3D000): No database selected

    please give suggestion to eradicate the above problem.

    thanyou.
    -RAJU
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Originally posted by rajbala
    hi all,

    I got the error like
    [sait6@localhost treestructure]$ mysqladmin -h localhost -u root -p create bedrock
    Enter password: ******
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localho st' (using password: YES)'

    [sait6@localhost treestructure]$ mysqladmin --no-defaults -u root ver
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localho st' (using password: NO)'


    and when i type mysql and start to change some password i got

    mysql> INSERT INTO user (Host,User,Pass word)
    -> VALUES('%','sai t6','sait123');
    ERROR 1046 (3D000): No database selected

    please give suggestion to eradicate the above problem.

    thanyou.
    -RAJU
    In the first case you obviously eneterd an incorrect password.
    The second case failed because you need a password.
    Case three: did you enter the 'use database;' command before the insert command?

    Ronald :cool:

    Comment

    • rajbala
      New Member
      • Oct 2006
      • 58

      #3
      Originally posted by ronverdonk
      In the first case you obviously eneterd an incorrect password.
      The second case failed because you need a password.
      Case three: did you enter the 'use database;' command before the insert command?

      Ronald :cool:
      hi,
      tankQ.But i had checked each and every one.
      I never set any password. If it is case i set the default password also.
      same error.

      now i has new a error.

      [root@localhost sait6]# mysql
      ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

      I am in starting stage for instaling the sql.
      ThankQ
      -raju

      Comment

      • rajbala
        New Member
        • Oct 2006
        • 58

        #4
        hi all,
        now i got the new problem...... I want to explained from first .....
        I download :

        MySQL-server-5.0.24a-0.glibc23.i386. rpm
        MySQL-client-5.0.24a-0.glibc23.i386. rpm

        I start installing in terminal...

        [root@localhost mydb]# rpm -ivh MySQL-server-5.0.24a-0.glibc23.i386. rpm
        MySQL-client-5.0.24a-0.glibc23.i386. rpm

        After this command it just hang up:
        now i pressed cntrl+z

        I got
        [2]+ Stopped rpm -ivh
        MySQL-server-5.0.24a-0.glibc23.i386. rpm
        MySQL-client-5.0.24a-0.glibc23.i386. rpm

        I dont why at starting itself it hanging up.
        please give suggestion for my problem.

        ThanQ

        -Raju

        Comment

        • sashi
          Recognized Expert Top Contributor
          • Jun 2006
          • 1749

          #5
          Originally posted by rajbala
          hi all,
          now i got the new problem...... I want to explained from first .....
          I download :

          MySQL-server-5.0.24a-0.glibc23.i386. rpm
          MySQL-client-5.0.24a-0.glibc23.i386. rpm

          I start installing in terminal...

          [root@localhost mydb]# rpm -ivh MySQL-server-5.0.24a-0.glibc23.i386. rpm
          MySQL-client-5.0.24a-0.glibc23.i386. rpm

          After this command it just hang up:
          now i pressed cntrl+z

          I got
          [2]+ Stopped rpm -ivh
          MySQL-server-5.0.24a-0.glibc23.i386. rpm
          MySQL-client-5.0.24a-0.glibc23.i386. rpm

          I dont why at starting itself it hanging up.
          please give suggestion for my problem.

          ThanQ

          -Raju
          Hi there,

          Please type the below command to list all the MySQL related packages installed on your machine. Please post the output on your next post. Good luck & take care.

          Code:
            rpm -q mysql

          Comment

          • rajbala
            New Member
            • Oct 2006
            • 58

            #6
            Originally posted by sashi
            Hi there,

            Please type the below command to list all the MySQL related packages installed on your machine. Please post the output on your next post. Good luck & take care.

            Code:
              rpm -q mysql
            hi,
            I had type command given by you...... and result is........

            [root@localhost mydb]# rpm -q mysql
            package mysql is not installed

            thanyou
            -raju

            Comment

            • rajbala
              New Member
              • Oct 2006
              • 58

              #7
              Hi sashi,
              still i can't able to instal sql to my PC.please help me.
              thanQ
              -raju

              Originally posted by rajbala
              hi,
              I had type command given by you...... and result is........

              [root@localhost mydb]# rpm -q mysql
              package mysql is not installed

              thanyou
              -raju

              Comment

              • bartonc
                Recognized Expert Expert
                • Sep 2006
                • 6478

                #8
                Originally posted by rajbala
                Hi sashi,
                still i can't able to instal sql to my PC.please help me.
                thanQ
                -raju
                If this is a windows machine, you should get the .msi and let it do the work of installing. What is your OS, anyway?

                Comment

                • sashi
                  Recognized Expert Top Contributor
                  • Jun 2006
                  • 1749

                  #9
                  Originally posted by bartonc
                  If this is a windows machine, you should get the .msi and let it do the work of installing. What is your OS, anyway?
                  Hi Bartnoc,

                  Raju is on Linux box, I suspect that he did not select/install the mysql-devel package during his initial Linux installation.

                  [root@localhost mydb]# rpm -ivh MySQL-server-5.0.24a-0.glibc23.i386. rpm

                  Comment

                  • rajbala
                    New Member
                    • Oct 2006
                    • 58

                    #10
                    Originally posted by sashi
                    Hi Bartnoc,

                    Raju is on Linux box, I suspect that he did not select/install the mysql-devel package during his initial Linux installation.
                    hi,
                    I again instal the sql I got the same error.....

                    [root@localhost mydb]# mysqladmin -u root password 'sait123'
                    mysqladmin: connect to server at 'localhost' failed
                    error: 'Access denied for user 'root'@'localho st' (using password: NO)'

                    Suggest me for above problem.
                    ThankQ
                    -Raju

                    Comment

                    • sashi
                      Recognized Expert Top Contributor
                      • Jun 2006
                      • 1749

                      #11
                      Originally posted by rajbala
                      hi,
                      I again instal the sql I got the same error.....

                      [root@localhost mydb]# mysqladmin -u root password 'sait123'
                      mysqladmin: connect to server at 'localhost' failed
                      error: 'Access denied for user 'root'@'localho st' (using password: NO)'

                      Suggest me for above problem.
                      ThankQ
                      -Raju
                      Hi Raju,

                      I was just wondering about why you need to use mysqladmin? Creating new database or what? Instead you can use mysql. You don't need to include any password with the above command as you have not changed the mysql initial password.

                      Kindly refer to below attached link for further reading & understanding, hope it helps. Good luck & Take care.

                      Comment

                      • rajbala
                        New Member
                        • Oct 2006
                        • 58

                        #12
                        Originally posted by sashi
                        Hi Raju,

                        I was just wondering about why you need to use mysqladmin? Creating new database or what? Instead you can use mysql. You don't need to include any password with the above command as you have not changed the mysql initial password.

                        Kindly refer to below attached link for further reading & understanding, hope it helps. Good luck & Take care.

                        http://coronet.iicm.edu/mysql/create.html
                        Hi sashi,
                        Ok i am not stick on mysqladmin.
                        As per link i tried. See the below commands which i used.

                        [sait6@localhost mydb]$ mysql
                        Welcome to the MySQL monitor. Commands end with ; or \g.
                        Your MySQL connection id is 10 to server version: 5.0.24a-standard

                        Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

                        mysql> USE mysql;
                        ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'

                        mysql> CREATE DATABASE mysql;
                        ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'

                        Please suggest me nex what i can do...
                        ThanQ for the link.
                        -raju

                        Comment

                        • sashi
                          Recognized Expert Top Contributor
                          • Jun 2006
                          • 1749

                          #13
                          Originally posted by rajbala
                          Hi sashi,
                          Ok i am not stick on mysqladmin.
                          As per link i tried. See the below commands which i used.

                          [sait6@localhost mydb]$ mysql
                          Welcome to the MySQL monitor. Commands end with ; or \g.
                          Your MySQL connection id is 10 to server version: 5.0.24a-standard

                          Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

                          mysql> USE mysql;
                          ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'

                          mysql> CREATE DATABASE mysql;
                          ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'

                          Please suggest me nex what i can do...
                          ThanQ for the link.
                          -raju
                          Hi Raju,

                          I think i know the reason for this error, MySQL daemon is only started upon request, instead it can be started at boot time itself. Kindly issue the following command, hope it helps. Good luck & Take care.

                          Use chkconfig to set the runlevel preferences
                          Code:
                            chkconfig mysqld --level 345 on
                          Restart mysql daemon
                          Code:
                            service mysqld restart
                          Check mysql daemon status
                          Code:
                            service mysqld status

                          Comment

                          • sashi
                            Recognized Expert Top Contributor
                            • Jun 2006
                            • 1749

                            #14
                            Originally posted by rajbala
                            Hi sashi,
                            Ok i am not stick on mysqladmin.
                            As per link i tried. See the below commands which i used.

                            [sait6@localhost mydb]$ mysql
                            Welcome to the MySQL monitor. Commands end with ; or \g.
                            Your MySQL connection id is 10 to server version: 5.0.24a-standard

                            Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

                            mysql> USE mysql;
                            ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'

                            mysql> CREATE DATABASE mysql;
                            ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'

                            Please suggest me nex what i can do...
                            ThanQ for the link.
                            -raju
                            Hi Raju,

                            Wait a second, are you accesing MySQL as user root? Does this user "saitxyz" have access to use any database on the server? Please check these details.

                            Comment

                            • rajbala
                              New Member
                              • Oct 2006
                              • 58

                              #15
                              Originally posted by sashi
                              Hi Raju,
                              Wait a second, are you accesing MySQL as user root? Does this user "saitxyz" have access to use any database on the server? Please check these details.
                              Hi sashi,
                              I had checked Thankyou for sugesstion alot and very lot.
                              Because I got it.

                              Instead of using the database of "mysql" i had use "test"

                              Code:
                              mysql> USE test;
                              Reading table information for completion of table and column names
                              You can turn off this feature to get a quicker startup with -A
                               
                              Database changed
                              Now i am using sql command.
                              -Thanq Mr.sashi

                              Raju

                              Comment

                              Working...