Welcome to Dream.In.Code
Become an Expert!

Join 149,541 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,548 people online right now. Registration is fast and FREE... Join Now!




MySQL Is Being A Biznatch. . .

 
Reply to this topicStart new topic

MySQL Is Being A Biznatch. . .

The Neoracle
7 Jun, 2002 - 02:15 PM
Post #1

Check, check, 1, 2.
Group Icon

Joined: 30 Mar, 2001
Posts: 4,069



Thanked: 1 times
My Contributions
Ok, I'm trying to get mysql to play nice on my machine and i keep getting this error:
SQL
[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
User is offlineProfile CardPM
+Quote Post

The Neoracle
RE: MySQL Is Being A Biznatch. . .
7 Jun, 2002 - 02:16 PM
Post #2

Check, check, 1, 2.
Group Icon

Joined: 30 Mar, 2001
Posts: 4,069



Thanked: 1 times
My Contributions
BTW, This works:
SQL
[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>

User is offlineProfile CardPM
+Quote Post

The Neoracle
RE: MySQL Is Being A Biznatch. . .
7 Jun, 2002 - 02:18 PM
Post #3

Check, check, 1, 2.
Group Icon

Joined: 30 Mar, 2001
Posts: 4,069



Thanked: 1 times
My Contributions
I also get this error:

CODE

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:
CODE
<?
  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>";
?>

User is offlineProfile CardPM
+Quote Post

skyhawk133
RE: MySQL Is Being A Biznatch. . .
7 Jun, 2002 - 02:28 PM
Post #4

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 15,262



Thanked: 61 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
<cough> Get a PC </cough>
User is offlineProfile CardPM
+Quote Post

The Neoracle
RE: MySQL Is Being A Biznatch. . .
7 Jun, 2002 - 02:41 PM
Post #5

Check, check, 1, 2.
Group Icon

Joined: 30 Mar, 2001
Posts: 4,069



Thanked: 1 times
My Contributions
QUOTE(skyhawk133 @ Jun 7 2002, 07:28 PM)
<cough> Get a PC </cough>

<cough>suck it</cough>
User is offlineProfile CardPM
+Quote Post

gneato
RE: MySQL Is Being A Biznatch. . .
7 Jun, 2002 - 04:04 PM
Post #6

<title>Untitled Document</title>
*****

Joined: 3 Sep, 2001
Posts: 1,311

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>
User is offlineProfile CardPM
+Quote Post

The Neoracle
RE: MySQL Is Being A Biznatch. . .
7 Jun, 2002 - 04:24 PM
Post #7

Check, check, 1, 2.
Group Icon

Joined: 30 Mar, 2001
Posts: 4,069



Thanked: 1 times
My Contributions
QUOTE(gneato @ Jun 7 2002, 09: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>

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.

mad.gif
User is offlineProfile CardPM
+Quote Post

gneato
RE: MySQL Is Being A Biznatch. . .
7 Jun, 2002 - 07:32 PM
Post #8

<title>Untitled Document</title>
*****

Joined: 3 Sep, 2001
Posts: 1,311

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.
User is offlineProfile CardPM
+Quote Post

Script_Daddy!
RE: MySQL Is Being A Biznatch. . .
18 Jun, 2002 - 10:27 AM
Post #9

New D.I.C Head
*

Joined: 18 Jun, 2002
Posts: 3

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

Ben
User is offlineProfile CardPM
+Quote Post

The Neoracle
RE: MySQL Is Being A Biznatch. . .
18 Jun, 2002 - 10:30 AM
Post #10

Check, check, 1, 2.
Group Icon

Joined: 30 Mar, 2001
Posts: 4,069



Thanked: 1 times
My Contributions
QUOTE(Script_Daddy! @ Jun 18 2002, 03:27 PM)
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.
User is offlineProfile CardPM
+Quote Post

Script_Daddy!
RE: MySQL Is Being A Biznatch. . .
18 Jun, 2002 - 01:32 PM
Post #11

New D.I.C Head
*

Joined: 18 Jun, 2002
Posts: 3

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
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 09:24PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month