Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I set a password for MySQL?

Status
Not open for further replies.

raefe77

Technical User
Aug 10, 2006
29
CH

Following the Open CMS installation documentation, I need to enter the following commands at the MySQL command line:

Code:
use mysql;
insert into user values ('localhost', 'opencmsuser', password('XXXXX'),\
    'N','N','N','N','N','N','N','N','N','N','N','N','N','N');
insert into db values ('localhost', 'opencms', 'opencmsuser',\
    'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
flush privileges;

But i get this error message: ERROR 1136 (21S01): Column count doesn't match value count at row 1

(Make sure you replace opencmsuser and opencms with the name of your user and database in case you have changed them on the setup wizard.)

I read somewhere that the tables in the database might not correspond to each other. But I did a fresh installation so the documentation will surely be correct!?

I am new to MySql, so please help me with step-by-step instructions on what I shoudl do next please.
 
I understand that this has gotten far-fetched, as it should be a simple, standard procedure (passwort setting)!?

In my first post, you see what the OpenCMS has told me to do to set the password. But I get:
Code:
ERROR 1136 (21S01): Column count doesn't match value count at row 1
I suppose my 3rd post would be best to continue with, as desc user gives me 37 rows in set.

After this is where it starts to get confusing, so maybe you could help me get through the exact number of 'N' and 'Y's I need depending on my table?

I am not sure about the 'opencmsuser' name. Will this be my Windows account name (e.g. MainPC), that I log on with? Or do I not have to change this (opencmsuser), only the password (XXXXX)?

Are the 37 rows all N (user values) or are some Y (
db values)? COULD YOU PLEASE PASTE ME THE CORRECT COMMAND LINE ?
 
Its not rocket science, you have 37 fields in user, you need to enter 37 pieces of information *unless* you specify which fields you wish to update, and in this case you would only provide the equivalent number of fields.

I have pasted you the command line several times, under the circumstances, reading and understanding the mysql manual would be of benefit!

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Yes, and I responded giving the output "Empty set (0.05 sec)".

I think you were the closest to getting there, but there must be something else to it. I got no additional row of info. Just the 'mysql>' command again.
 
Howcome it seems to be that just when a solution is about to come around, either someone else tells me another thing or the last person doesn't finish...!? :(

Maybe someone else can tell me: is it really necessary to passwort secure MySql against hackers? How secure is this, seing as I have it on the main server (business internally there is no problem with it being unsecured).
 
to quote myself:
insert into user (Host,User,Password,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Reload_priv,Shutdown_priv,Process_priv,File_priv,Grant_priv,References_priv,Index_priv,Alter_priv,Show_db_priv,Super_priv,Create_tmp_table_pri,Lock_tables_priv,Execute_priv,Repl_slave_priv,Repl_client_priv,Create_view_priv,Show_view_priv,Create_routine_priv,Alter_routine_priv,Create_user_priv
) values ('your_host','your_username',password('your_password'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');

et voila.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top