10 Replies - 1978 Views - Last Post: 18 June 2002 - 02:32 PM

#1 The Neoracle  Icon User is offline

  • Check, check, 1, 2.
  • member icon

Reputation: 21
  • View blog
  • Posts: 4,097
  • Joined: 30-March 01

MySQL Is Being A Biznatch. . .

Posted 07 June 2002 - 03:15 PM

Ok, I'm trying to get mysql to play nice on my machine and i keep getting this error:
[localhost:~] bjclark% mysql -u root
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)


Any ideas? I'm on OS X but it should be just like on Linux/Unix

And this is why we have SQL buttons

Is This A Good Question/Topic? 0
  • +

Replies To: MySQL Is Being A Biznatch. . .

#2 The Neoracle  Icon User is offline

  • Check, check, 1, 2.
  • member icon

Reputation: 21
  • View blog
  • Posts: 4,097
  • Joined: 30-March 01

Re: MySQL Is Being A Biznatch. . .

Posted 07 June 2002 - 03:16 PM

BTW, This works:
[localhost:~] bjclark% mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 16 to server version: 3.23.49-entropy.ch

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

mysql>

Was This Post Helpful? 0
  • +
  • -

#3 The Neoracle  Icon User is offline

  • Check, check, 1, 2.
  • member icon

Reputation: 21
  • View blog
  • Posts: 4,097
  • Joined: 30-March 01

Re: MySQL Is Being A Biznatch. . .

Posted 07 June 2002 - 03:18 PM

I also get this error:

Warning:  Access denied for user: 'root@localhost' (Using password: YES) in /Library/WebServer/Documents/test.php on line 5



Warning:  MySQL Connection Failed: Access denied for user: 'root@localhost' (Using password: YES)
 in /Library/WebServer/Documents/test.php on line 5



Warning:  Access denied for user: 'root@localhost' (Using password: NO) in /Library/WebServer/Documents/test.php on line 9



Warning:  MySQL Connection Failed: Access denied for user: 'root@localhost' (Using password: NO)
 in /Library/WebServer/Documents/test.php on line 9



Warning:  MySQL:  A link to the server could not be established in /Library/WebServer/Documents/test.php on line 9

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



when I run this:
<?
   print "<pre>";

   // log into our local server using the MySQL root user.
   $dbh = mysql_connect( "localhost", "root", "password" );


   // select the 'test' database created during installation.
   mysql_select_db( "test" ) or die ( mysql_error() . "\n" );
   print "Connection to the database has been established.\n";


   // create a simplistic table.
   $table = "CREATE table wisdom (
             id int(4) PRIMARY KEY AUTO_INCREMENT,
             wisdom char(255), author char(125) );";

   $response = mysql_query( $table, $dbh );
   if ($response) { print "The table was created correctly!\n"; }
   else { print mysql_error () . "\n"; }


   // now, we'll add some data to our newly created table.
   // to add different wisdom, just change the 'values'.
   $insert_data = "INSERT into wisdom ( wisdom, author ) 
                   values ( 'Must... remain... awake!', 'Morbus' );";

   $response = mysql_query( $insert_data, $dbh );
   if ($response) { print "The data was inserted correctly!\n"; }
   else { print mysql_error () . "\n"; }


   // and read it back for printing purposes.
   $get_table_data = "SELECT * FROM wisdom;";
   $response = mysql_query( $get_table_data, $dbh );
   if ($response) { print "We successfully got all the table data.\n"; }
   else { print mysql_error () . "\n"; }


   // now print it out for the user.
   while ( $one_line_of_data = mysql_fetch_array( $response ) ) {
       extract ( $one_line_of_data );
       print "#$id: $author sez: \"$wisdom\"\n"; 
   }

   print "</pre>";
?>

Was This Post Helpful? 0
  • +
  • -

#4 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1876
  • View blog
  • Posts: 20,284
  • Joined: 17-March 01

Re: MySQL Is Being A Biznatch. . .

Posted 07 June 2002 - 03:28 PM

<cough> Get a PC </cough>
Was This Post Helpful? 0
  • +
  • -

#5 The Neoracle  Icon User is offline

  • Check, check, 1, 2.
  • member icon

Reputation: 21
  • View blog
  • Posts: 4,097
  • Joined: 30-March 01

Re: MySQL Is Being A Biznatch. . .

Posted 07 June 2002 - 03:41 PM

skyhawk133, on Jun 7 2002, 07:28 PM, said:

<cough> Get a PC </cough>

<cough>suck it</cough>
Was This Post Helpful? 0
  • +
  • -

#6 gneato  Icon User is offline

  • <title>Untitled Document</title>

Reputation: 0
  • View blog
  • Posts: 1,311
  • Joined: 03-September 01

Re: MySQL Is Being A Biznatch. . .

Posted 07 June 2002 - 05:04 PM

First, set the mysql password:

If you don't have a MySQL password yet...
root@localhost: /root
$ mysqladmin -u root password new_pass

If you have a MySQL pass already...
root@localhost: /root
$ mysqladmin -u root -p password new_pass
Enter password: (type current pass)


Then:

mysql -u root -p

In use:

root@localhost: /root
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15 to server version: 3.23.49

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

mysql>
Was This Post Helpful? 0
  • +
  • -

#7 The Neoracle  Icon User is offline

  • Check, check, 1, 2.
  • member icon

Reputation: 21
  • View blog
  • Posts: 4,097
  • Joined: 30-March 01

Re: MySQL Is Being A Biznatch. . .

Posted 07 June 2002 - 05:24 PM

gneato, on Jun 7 2002, 09:04 PM, said:

First, set the mysql password:

If you don't have a MySQL password yet...
root@localhost: /root
$ mysqladmin -u root password new_pass

If you have a MySQL pass already...
root@localhost: /root
$ mysqladmin -u root -p password new_pass
Enter password: (type current pass)


Then:

mysql -u root -p

In use:

root@localhost: /root
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15 to server version: 3.23.49

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

mysql>

See, but I've set it already to something but I don't know what the current root password is.
I read that I could re-start it using the --skip-grant-tables, but I can't shut it down cause I don't have access and I can't kill the process cause it' just restarts automaticly.

:angry:
Was This Post Helpful? 0
  • +
  • -

#8 gneato  Icon User is offline

  • <title>Untitled Document</title>

Reputation: 0
  • View blog
  • Posts: 1,311
  • Joined: 03-September 01

Re: MySQL Is Being A Biznatch. . .

Posted 07 June 2002 - 08:32 PM

Where did you set it up?

If you used the command I gave here (or any command with the password in it), you can hit your up arrow in the terminal to go through the previous commands used. As long as it wasn't too long ago, it should be in the history.
Was This Post Helpful? 0
  • +
  • -

#9 Script_Daddy!  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-June 02

Re: MySQL Is Being A Biznatch. . .

Posted 18 June 2002 - 11:27 AM

Kill the safe_mysqld process. That script automatically restart the mySQL if it's killed.

Ben
Was This Post Helpful? 0
  • +
  • -

#10 The Neoracle  Icon User is offline

  • Check, check, 1, 2.
  • member icon

Reputation: 21
  • View blog
  • Posts: 4,097
  • Joined: 30-March 01

Re: MySQL Is Being A Biznatch. . .

Posted 18 June 2002 - 11:30 AM

Script_Daddy!, on Jun 18 2002, 03:27 PM, said:

Kill the safe_mysqld process. That script automatically restart the mySQL if it's killed.

Ben

Well, I've done that. And Killed the MySQLd Process but then I get errors because that doesnt' get rid of the .socket

If the actual error will help, I can try to redo it.
Was This Post Helpful? 0
  • +
  • -

#11 Script_Daddy!  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-June 02

Re: MySQL Is Being A Biznatch. . .

Posted 18 June 2002 - 02:32 PM

Can't you just disable it at boot time. Have you checked the /etc/rc.d area for a reference to the safe_mysqld script. Just comment out the line and reboot.

Ben
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1