MySQL users

evildan

Super Moderator
I'm very very very new to MySQL.

-I'm on OSX 10.2.x
-MySQL (4.0.12) (installed "complete MySQL from www.aaronfaby.com)

I'm trying to create a new user but I'm running into a few problems.

1) How do I log in as root (MySQL) from the terminal?

After trying a few different techniques, I got frustrated and downloaded YourSQL and installed it.

Before installing this program when I did a "SHOW DATABASES;" from the mysql prompt, it only resulted in displaying my "test" database.

This program is great. I was able to actually log into the mysql database as root and even create another "test" database.

...On to problem #2

I'm working on a project which requires the creation of a new user in the mqsql database.

Simple enough with "YourSQL" I thought. After attempting to create a new row, (in the "user" table) I can't even get past the first field, I keep getting an error "no value specified for parameter 26" then the application quits. I'm unable to tab out of the first field (which is the host field).

I've tried creating/removing etc tables, rows and data in my test database with no problem. But every attempt to modify the mysql database has caused problem after problem.

What can I do?

Unfortunately two seemingly incomplete rows have been created, and my attempts cannot even be deleted (using YourSQL) as the error occurs again and the application quits as soon as I click the "delete" button.

I'm hoping that there's a way to remove those rows in the terminal, but I cannot seem to connect to the mysql database at all from the terminal. I only can access it by using the YourSQL GUI. Just by doing this shows me that my account information is configured properly and working... So I've tentatively ruled out a permission problem.

I have 0% configuration, except for assigning a password for root, I'm still at default settings.

Any help would be greatly appreciated. ;)
 
I found the answer to my question on another forum, so I thought I might list it here, just in case anyone else has a problem.

An important side note is that you have to make a distinction between system users and mysql users. In order to connect to the mysql database (the main database) you have to connect as the mysql root.

To connect to mysql using the terminal:

1) Open the terminal and type:
/path/to/mysql -u root -p

You will be asked for the password, enter your mysql root password and hit enter.

You should be connected.

If the above line didn't work, try this:
/path/to/mysql -u root@localhost -p

...then enter your password when asked.

This is the extent of my knowledge regarding logging into MySQL.

You can tell you're logged into mysql as root, if, after you connect, you see A) the mysql prompt and B) when you issue the following command: SHOW DATABASES;

you see the "mysql" database listed with your other databases.

I hope this helps.
 
Back
Top