Unix Technical Forum

Mysql

This is a discussion on Mysql within the SUSE Linux forums, part of the Unix Operating Systems category; --> houghi wrote: > David Bolt wrote: >> [0] IIRC, when you start up the mysql daemon for the first ...


Go Back   Unix Technical Forum > Unix Operating Systems > SUSE Linux

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #21 (permalink)  
Old 04-03-2008, 02:45 PM
Michael Soibelman
 
Posts: n/a
Default Re: Mysql

houghi wrote:

> David Bolt wrote:
>> [0] IIRC, when you start up the mysql daemon for the first time, it asks
>> you to set a password for user root at localhost and also for
>> root@your.host.name using /usr/bin/mysqladmin. If you haven't done very
>> much you might be lucky and find that command, including the password
>> you set, in your bash history.

>
> The confusion comes from the fact that the user `root` on a system is
> a user that has access to everything, while this is not true for a user
> `root` in MySQL.
>
> There the user can be anybody, including `root` or `mysql_root` or
> `anything_you_desire` and there has to be no relation perse between the
> users on the system and the users in MySQL.
> Even worse is that MySQL can work perfectly without the yser 'root' in
> MySQL and on some places I read that having 'root' in MySQL could be a
> security problem.
>
> Setting MySQL up is not the most logical thing to do. Hence bug #347149
> Took me a long time to grasp that as well.
>
> houghi


Thanks for this information. This helps clarify some problems I had in the
past about root in SuSE & root for MySQL. I've read and re-read the
documentation and have had some 'huh ?' moments as the documents are a bit
terse and complicated. I think it would be nice if Yast had a module for
setting up MySQL including a help assistant too.

Anyway, thanks for pointing this (ROOT v root) out. Now I (we) know.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #22 (permalink)  
Old 04-03-2008, 02:45 PM
houghi
 
Posts: n/a
Default Re: Mysql

Michael Soibelman wrote:
> Thanks for this information. This helps clarify some problems I had in the
> past about root in SuSE & root for MySQL. I've read and re-read the
> documentation and have had some 'huh ?' moments as the documents are a bit
> terse and complicated. I think it would be nice if Yast had a module for
> setting up MySQL including a help assistant too.
>
> Anyway, thanks for pointing this (ROOT v root) out. Now I (we) know.


You are welcome. It is strange that this is something that is not often
explained better. Especialy as the logins all start with login 'root'
and that is not needed. So why use that as an example?

A simple paragraph explaining the difference should help a LOT of people
starting with MySQL

houghi
--
They say pesticides have been linked to low sperm counts.
In my opinion if you have bugs down there that are so bad
you need to use a pesticide, you're not gonna get laid anyway.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #23 (permalink)  
Old 04-03-2008, 02:45 PM
=?ISO-8859-1?Q?Blattus_Slafaly_0/00_=3F_=3F_=3F?=
 
Posts: n/a
Default Re: Mysql

David Bolt wrote:
> On Sun, 30 Mar 2008, Blattus Slafaly 0/00 ? ? ? wrote:-
>
> <snip>
>
>> Why do I get this with mysqlshow?

>
> No idea. I don't use it.
>
>> mysqlshow: Access denied for user 'username'@'localhost' (using
>> password: NO)

>
> Did you "create" a user with access to the database without a password?
>
>> and as root:
>> mysqlshow: Access denied for user 'root'@'localhost' (using password: YES)

>
> Either the root user doesn't have a password configured, or you've
> entered the wrong one. Try using a console and use mysql:
>
> mysql -h localhost -u root
>
> This will try to log you in without a password. If it fails, try:
>
> mysql -h localhost -u root -p
>
> You'll be asked to enter the password for root[0].
>
>> why can't I access my own system?

>
> Because you aren't entering the correct details. Try the above, and see
>
>
> [0] IIRC, when you start up the mysql daemon for the first time, it asks
> you to set a password for user root at localhost and also for


It did not ask me anything when I started msyld.

> root@your.host.name using /usr/bin/mysqladmin. If you haven't done very
> much you might be lucky and find that command, including the password
> you set, in your bash history.
>
> Regards,
> David Bolt
>



--
Blattus Slafaly ? 3 7/8
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #24 (permalink)  
Old 04-03-2008, 02:45 PM
Michael Soibelman
 
Posts: n/a
Default Re: Mysql

Blattus Slafaly 0/00 ? ? ? wrote:

> David Bolt wrote:
>> On Sun, 30 Mar 2008, Blattus Slafaly 0/00 ? ? ? wrote:-
>>
>> <snip>
>>
>>> Why do I get this with mysqlshow?

>>
>> No idea. I don't use it.
>>
>>> mysqlshow: Access denied for user 'username'@'localhost' (using
>>> password: NO)

>>
>> Did you "create" a user with access to the database without a password?
>>
>>> and as root:
>>> mysqlshow: Access denied for user 'root'@'localhost' (using password:
>>> YES)

>>
>> Either the root user doesn't have a password configured, or you've
>> entered the wrong one. Try using a console and use mysql:
>>
>> mysql -h localhost -u root
>>
>> This will try to log you in without a password. If it fails, try:
>>
>> mysql -h localhost -u root -p
>>
>> You'll be asked to enter the password for root[0].
>>
>>> why can't I access my own system?

>>
>> Because you aren't entering the correct details. Try the above, and see
>>
>>
>> [0] IIRC, when you start up the mysql daemon for the first time, it asks
>> you to set a password for user root at localhost and also for

>
> It did not ask me anything when I started msyld.
>

Then you have not set up any users/passwords. Follow the advice given in
this thread and do so now. David's suggestions would be a good start.

Repeat. You have NOT set any users/passwords. Do so now. Then use one of
the gui to administer your database(s).
>> root@your.host.name using /usr/bin/mysqladmin. If you haven't done very
>> much you might be lucky and find that command, including the password
>> you set, in your bash history.
>>
>> Regards,
>> David Bolt
>>

>
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #25 (permalink)  
Old 04-03-2008, 02:45 PM
=?ISO-8859-1?Q?Blattus_Slafaly_0/00_=3F_=3F_=3F?=
 
Posts: n/a
Default Re: Mysql

David Bolt wrote:
> On Sun, 30 Mar 2008, Blattus Slafaly 0/00 ? ? ? wrote:-
>
> <snip>
>
>> Why do I get this with mysqlshow?

>
> No idea. I don't use it.
>
>> mysqlshow: Access denied for user 'username'@'localhost' (using
>> password: NO)

>
> Did you "create" a user with access to the database without a password?
>
>> and as root:
>> mysqlshow: Access denied for user 'root'@'localhost' (using password: YES)

>
> Either the root user doesn't have a password configured, or you've
> entered the wrong one. Try using a console and use mysql:
>
> mysql -h localhost -u root
>
> This will try to log you in without a password. If it fails, try:
>
> mysql -h localhost -u root -p
>
> You'll be asked to enter the password for root[0].
>
>> why can't I access my own system?

>
> Because you aren't entering the correct details. Try the above, and see
>
>
> [0] IIRC, when you start up the mysql daemon for the first time, it asks
> you to set a password for user root at localhost and also for
> root@your.host.name using /usr/bin/mysqladmin. If you haven't done very
> much you might be lucky and find that command, including the password
> you set, in your bash history.
>
> Regards,
> David Bolt
>


It won't accept my hostname. I get up to mysqladmin version, works ok.

Then mysqlshow fails. Mysqladmin -u root password new_password works,

mysqladmin -u root -h my_system_hostname password mysql_root_password
fails, cannot access with that hostname.

I'm following the Suse Linux 10 Unleashed manual page 520 to 525. It
makes me angry when I follow directions and they don't work.
I uninstall the whole dam thing and deleted everything again.



--
Blattus Slafaly ? 3 7/8
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #26 (permalink)  
Old 04-03-2008, 02:45 PM
David Bolt
 
Posts: n/a
Default Re: Mysql

On Mon, 31 Mar 2008, Blattus Slafaly 0/00 ? ? ? wrote:-

>It won't accept my hostname. I get up to mysqladmin version, works ok.
>
>Then mysqlshow fails. Mysqladmin -u root password new_password works,
>
>mysqladmin -u root -h my_system_hostname password mysql_root_password
>fails, cannot access with that hostname.


I found that part of that problem was caused by having the host name
entered into /etc/hosts. In my case I removed the entry:

127.0.0.2 lion.davjam.org lion

then logged in using:

mysql -h localhost -u root -p

After that, I entered these two commands:

grant all privileges on *.* to 'root'@'lion.davjam.org' identified by '<my password>';
grant grant option on *.* to 'root'@'lion.davjam.org' identified by '<my password>';

The first command, despite saying all privileges, doesn't give the
ability to grant users access rights. Using the second command gives the
user that ability. After that, I logged out again and re-logged in
using:

mysql -h lion.davjam.org -u root -p

and created a new user using:

grant all privileges on test.* to 'username'@'<my.host.name>' identified by '<users password>';


>I'm following the Suse Linux 10 Unleashed manual page 520 to 525. It
>makes me angry when I follow directions and they don't work.
>I uninstall the whole dam thing and deleted everything again.


Okay. First thing I do when something is that frustrating is to walk
away from it, do something else and then return to it when I'm more
relaxed. It saves me from doing things like uninstalling things when I'm
only got to reinstall them later.


Regards,
David Bolt

--
www.davjam.org/lifetype/ www.distributed.net: OGR@100Mnodes, RC5-72@15Mkeys
SUSE 10.1 32bit | openSUSE 10.2 32bit | openSUSE 10.3 32bit | openSUSE 11.0a1
SUSE 10.1 64bit | openSUSE 10.2 64bit | openSUSE 10.3 64bit
RISC OS 3.6 | TOS 4.02 | openSUSE 10.3 PPC |RISC OS 3.11
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #27 (permalink)  
Old 04-03-2008, 02:45 PM
David Bolt
 
Posts: n/a
Default Re: Mysql

On Sun, 30 Mar 2008, houghi wrote:-

>David Bolt wrote:
>> [0] IIRC, when you start up the mysql daemon for the first time, it asks
>> you to set a password for user root at localhost and also for
>> root@your.host.name using /usr/bin/mysqladmin. If you haven't done very
>> much you might be lucky and find that command, including the password
>> you set, in your bash history.

>
>The confusion comes from the fact that the user `root` on a system is
>a user that has access to everything, while this is not true for a user
>`root` in MySQL.


The confusion is probably because, after freshly installing mysql and
starting it for the first time, you get this[0]:

lion:~ # rcmysql start
Creating MySQL privilege database...
Installing MySQL system tables...
OK
Filling help tables...
OK
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h lion.davjam.org password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
Updating MySQL privilege database...
Looking for 'mysql' in: /usr/bin/mysql
Looking for 'mysqlcheck' in: /usr/bin/mysqlcheck
Running 'mysqlcheck'...
mysql.columns_priv OK
mysql.db OK
mysql.func OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.proc OK
mysql.procs_priv OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Running 'mysql_fix_privilege_tables'...
OK
Starting service MySQL done

>There the user can be anybody, including `root` or `mysql_root` or
>`anything_you_desire` and there has to be no relation perse between the
>users on the system and the users in MySQL.


In a way, there is. That first user has the ability to do anything to
the mysql daemon including creating and "deleting" users, although
"deleting" users is probably the wrong term for it. To delete a user,
you just revoke their access rights using:

revoke all on *.* from 'user@hostname';

and then they no longer have access to any of the databases.

>Even worse is that MySQL can work perfectly without the yser 'root' in
>MySQL and on some places I read that having 'root' in MySQL could be a
>security problem.


I've not read about that, but since I've not been chasing up that much
on mysql, it wouldn't surprise me if I'd missed it. If you can, can you
provide a citation for it?

>Setting MySQL up is not the most logical thing to do.


Presently it requires entering 2 commands straight after the initial
start-up to set up the "root" users account and password. What's so hard
about that?

>Hence bug #347149
>Took me a long time to grasp that as well.



[0] after freshly installing mysql-Max on 10.3 (PPC)

Regards,
David Bolt

--
www.davjam.org/lifetype/ www.distributed.net: OGR@100Mnodes, RC5-72@15Mkeys
SUSE 10.1 32bit | openSUSE 10.2 32bit | openSUSE 10.3 32bit | openSUSE 11.0a1
SUSE 10.1 64bit | openSUSE 10.2 64bit | openSUSE 10.3 64bit
RISC OS 3.6 | TOS 4.02 | openSUSE 10.3 PPC |RISC OS 3.11
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #28 (permalink)  
Old 04-03-2008, 02:45 PM
Vahis
 
Posts: n/a
Default Re: Mysql

On 2008-03-30, Michael Soibelman <in-the@ether.net> wrote:
> Vahis wrote:
>
>--------------------------snip------------------------------------
>> I wish you could have started in a different manner.
>> Now all I can say is the name of a movie that I have in my database:
>>
>>


>>
>> P.S. Your rediculous and crappy email address needs to be forced in
>> slrn. But you probably have no idea what that means either.
>>
>> Vahis

>
> Thanks for the hilarious post ! I'm LOL right now.... ;-)


> Obviously the group has helped you as your site is quite functional. Good
> work. If only newbies would learn not to bitch to get help (i.e. attention
> in this case). You have asked and received many times and I'm sure you'll
> agree that intelligent questions (usually) get intelligent answers.
>
> Again, good work on your (it aint crappy) MySQl enabled site. You've done
> well. Congratulations.
>


A lot of people have, indeed, especially David Bolt.
Linux is there because of a lot of people in the first place.

One of them was F.Z. He said among other things:
"In the Fight between You and the World... Bet on the World"

>
> PHP, MySQL, Linux, SuSE & Vahis rock.


Php is quite fascinating. Originally "Private Home Pages".

I'll put another test on line soon, Gallery.

I hope there are people here who know it...

I'm thinking about putting it on a public test.
There's a feature to hide albums. I'd like to see if they are any
hard to find, I have a lot to hide...

Vahis
--
Training new things here:
http://waxborg.servepics.com
"The only thing more expensive than training is the lack of it"
Henry Ford
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #29 (permalink)  
Old 04-03-2008, 02:45 PM
houghi
 
Posts: n/a
Default Re: Mysql

David Bolt wrote:
>>There the user can be anybody, including `root` or `mysql_root` or
>>`anything_you_desire` and there has to be no relation perse between the
>>users on the system and the users in MySQL.

>
> In a way, there is.


Thus my 'has to be'

> That first user has the ability to do anything to
> the mysql daemon including creating and "deleting" users, although
> "deleting" users is probably the wrong term for it. To delete a user,
> you just revoke their access rights using:


The first user can be called 'root', but that is just a name. You could
call the first user 'shirley'. The rights one 'root' user has, has no
impact on the other 'root'. And as both are on the same system, this can
confuse things even more.

Also on a company system, you might have different people that need to
log into the rights that the first user has in mysql, without the
rights.

> revoke all on *.* from 'user@hostname';
>
> and then they no longer have access to any of the databases.


I think it is easier to use phpMyAdmin after you have setup the initial
account. That however is a personal choice. There I can see that the
command to remove a user is `DROP USER 'root'@'localhost';`
Sure, disabeling the user is possible, if you want to enable the user
later.

>>Even worse is that MySQL can work perfectly without the yser 'root' in
>>MySQL and on some places I read that having 'root' in MySQL could be a
>>security problem.

>
> I've not read about that, but since I've not been chasing up that much
> on mysql, it wouldn't surprise me if I'd missed it. If you can, can you
> provide a citation for it?


Uh, my machine where I do not use root as a first user. The reason _I_
have for that is that I do not want to be using root, unless I realy,
realy, realy need it.

Obviously when I did Amarok with MySQL, I got to the page
http://amarok.kde.org/wiki/MySQL_HowTo and all I needed to do was the
following (as I already had a main user)
$ mysql -p -u houghi
CREATE DATABASE amarok;
USE amarok;
GRANT ALL ON amarok.* TO amarok@localhost IDENTIFIED BY 'pâsswØrd';
FLUSH PRIVILEGES;

and I was ready to go. (Obviously a fake password)
instead of
$ mysql -p -u root

>>Setting MySQL up is not the most logical thing to do.

>
> Presently it requires entering 2 commands straight after the initial
> start-up to set up the "root" users account and password. What's so hard
> about that?


It is not hard. It is confusing. Look around on the net about the amount
of people asking the same question. And why not make a small script
around it that does the apropriate test and if not, presents you with
the apropriate questions.

I remember I did many trials and it didn't work, because I misunderstood
what they were saying and because of the confusion of root and root.
Took me a LONG time to figure it out and it certainly held me back a few
years(!) before I delved into it and figured it out.

I tried everey few months and failed again. Finaly I figured it out by
using phpMyAdmin.

>>Hence bug #347149
>>Took me a long time to grasp that as well.


And this is the result. As they were already working on it internaly, I
asume they also got a lot of requests from people who were confused as
well.

It is not because it is not hard that it is easy.

houghi
--
houghi http://houghi.org http://www.plainfaqs.org/linux/
http://www.netmeister.org/news/learn2quote.html
>
> Today I went outside. My pupils have never been tinier...

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #30 (permalink)  
Old 04-03-2008, 02:45 PM
houghi
 
Posts: n/a
Default Re: Mysql

Michael Soibelman wrote:
> PHP, MySQL, Linux, SuSE & Vahis rock.


SuSE? Please upgrade. 8.0 is not suported anymore and is insecure.
Please upgrade to openSUSE. 10.3 is the latest version.

I am amazed that people still run that. It is a danger to do that. No
wonder MySQL was so hard to set up. You run an old version.

houghi
--
houghi http://houghi.org http://www.plainfaqs.org/linux/
http://www.netmeister.org/news/learn2quote.html
>
> Today I went outside. My pupils have never been tinier...

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:01 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com