Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mysql configuration
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
p2cd3
Tux's lil' helper
Tux's lil' helper


Joined: 29 Apr 2004
Posts: 95

PostPosted: Wed Apr 19, 2006 8:53 pm    Post subject: mysql configuration Reply with quote

I have follower along the MySQL Startup Guide - emerged OK, did: ebuild /var/db/pkg/dev-db/mysql-4.1.14-r1/mysql-4.1.14-r1.ebuild config

Binabik bin # /etc/init.d/mysql start
* WARNING: "mysql" has already been started.

Next step is:

Binabik bin # /usr/bin/mysqladmin -u root -h Binabik password 'new-password'
/usr/bin/mysqladmin: connect to server at 'Binabik' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

I can do this & mysql starts:
mysql -u root -h localhost -p

Also:
mysql -u jack -h localhost -p
works

BUT I cannot get "/usr/bin/mysqladmin -u root -h Binabik password 'new password' "to work as I am trying to setup Beancounter, it says I need user jack to config this - I allready have jack as a user in mysql
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Wed Apr 19, 2006 10:43 pm    Post subject: Reply with quote

because Mysql is bound to localhost by default and not to your hostname which is probably pointed to the IP on eth0. So either use localhost to connect to Mysql which is fine especially if no on eever needs to connect to Mysql remotely or enable Mysql on all IP's by removing the bind-address line in /etc/mysql/my.conf file and restarting.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
p2cd3
Tux's lil' helper
Tux's lil' helper


Joined: 29 Apr 2004
Posts: 95

PostPosted: Thu Apr 20, 2006 4:30 am    Post subject: Reply with quote

kashani, I do not have a problem to start mysql as root or as jack

"mysql -u jack -h localhost -p" will open mysql

My problem is I cannot :

Binabik ~ # /usr/bin/mysqladmin -u root -h localhost password 'new password'
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

This is what I am trying to open "mysqlsdmin"
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Thu Apr 20, 2006 4:54 am    Post subject: Reply with quote

p2cd3 wrote:
My problem is I cannot :

Binabik ~ # /usr/bin/mysqladmin -u root -h localhost password 'new password'
/usr/bin/mysqladmin: connect to server at 'localhost' failed

Pointing at the obvious... shouldn't it be /usr/bin/mysqladmin -u root -h localhost --password 'new password'
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
p2cd3
Tux's lil' helper
Tux's lil' helper


Joined: 29 Apr 2004
Posts: 95

PostPosted: Thu Apr 20, 2006 5:03 am    Post subject: Reply with quote

This is the result:

Binabik ~ # /usr/bin/mysqladmin -u root -h localhost --password 'new password'
Enter password:
/usr/bin/mysqladmin: Unknown command: 'new password'
Back to top
View user's profile Send private message
wizard69
Apprentice
Apprentice


Joined: 22 Sep 2003
Posts: 178
Location: Berlin

PostPosted: Thu Apr 20, 2006 11:39 am    Post subject: Reply with quote

Quote:
Binabik ~ # /usr/bin/mysqladmin -u root -h localhost --password 'new password'
Enter password:
/usr/bin/mysqladmin: Unknown command: 'new password'



the correct command is mysqladmin -u root -h localhost password 'new password'

then login with



mysql -u root -p (mysql wll prompt for your password) or

mysql -u root -h localhost -p
Back to top
View user's profile Send private message
DaveArb
Guru
Guru


Joined: 29 Apr 2004
Posts: 510
Location: Texas, USA

PostPosted: Thu Apr 20, 2006 2:11 pm    Post subject: Re: mysql configuration Reply with quote

p2cd3 wrote:
Binabik bin # /usr/bin/mysqladmin -u root -h Binabik password 'new-password'
/usr/bin/mysqladmin: connect to server at 'Binabik' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'


/usr/bin/mysqladmin -u root -p -h Binabik password 'new-password'
Enter password: <enter root@localhost's password>

Dave
Back to top
View user's profile Send private message
p2cd3
Tux's lil' helper
Tux's lil' helper


Joined: 29 Apr 2004
Posts: 95

PostPosted: Thu Apr 20, 2006 2:31 pm    Post subject: Reply with quote

This is the result:

Binabik ~ # /usr/bin/mysqladmin -u root -p -h Binabik Snowlock Snowlock
Enter password:
/usr/bin/mysqladmin: connect to server at 'Binabik' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
Back to top
View user's profile Send private message
p2cd3
Tux's lil' helper
Tux's lil' helper


Joined: 29 Apr 2004
Posts: 95

PostPosted: Thu Apr 20, 2006 2:39 pm    Post subject: Reply with quote

wizard69, I do not have a problem with accessing mysql, it is working, my problem is I cannot :

Binabik bin # /usr/bin/mysqladmin -u root -h Binabik password 'new-password'

I need this to make jack a user so I can get Beancounter to accept jack as a user

What is confusing me is that I have jack as a user & can open mysql with:

mysql -u jack -h localhost -p
Back to top
View user's profile Send private message
Corax
Apprentice
Apprentice


Joined: 14 Apr 2004
Posts: 222
Location: Berlin, Germany

PostPosted: Thu Apr 20, 2006 2:43 pm    Post subject: Reply with quote

IIRC, there must not be any spaces between --password and 'new-password'.
_________________
There's no such priest //
that can pray me to heaven.
-- Nightwish, "Bare grace misery"
Back to top
View user's profile Send private message
DaveArb
Guru
Guru


Joined: 29 Apr 2004
Posts: 510
Location: Texas, USA

PostPosted: Thu Apr 20, 2006 3:07 pm    Post subject: Reply with quote

p2cd3 wrote:
Binabik ~ # /usr/bin/mysqladmin -u root -p -h Binabik Snowlock Snowlock


That doesn't match the pattern...
/usr/bin/mysqladmin -u root -p -h Binabik password 'Snowlock'

It works on a machine I just tested it with. YMMV.

Dave
Back to top
View user's profile Send private message
p2cd3
Tux's lil' helper
Tux's lil' helper


Joined: 29 Apr 2004
Posts: 95

PostPosted: Thu Apr 20, 2006 3:39 pm    Post subject: Reply with quote

DaveArb, it accepted that entry

This is the problem, when I try to open Beancounter this happens:

jack@Binabik ~ $ setup_beancounter -m
Now using MySQL

*** Error: No mysql user 'jack'

We were unable to start mysql as the user 'jack' does not exist
You need to create a MySQL user 'jack' first:

Change to super user (MySQL Admin): $ su -
Start mysql program with mysql db: # mysql mysql
Create the user: grant all privileges on *.* to jack@localhost;
Exit from user mysql: > \q
Exit from super user: # exit

and then run this script again.

[ NB These instructions are currently approximative. Consult your manual. ]
[ And email me a better version :) ]

This is what happehs when I do the above:

mysql> grant all privileges on *.* to jack@localhost;
Query OK, 0 rows affected (0.00 sec)

mysql>

This tells me I have jack as a user, but, when I try to setup-beancounter it gives me the same message as above:

"*** Error: No mysql user 'jack'"
Back to top
View user's profile Send private message
Bad Penguin
Guru
Guru


Joined: 18 Aug 2004
Posts: 507

PostPosted: Thu Apr 20, 2006 6:54 pm    Post subject: Reply with quote

DaveArb wrote:
p2cd3 wrote:
Binabik ~ # /usr/bin/mysqladmin -u root -p -h Binabik Snowlock Snowlock


That doesn't match the pattern...
/usr/bin/mysqladmin -u root -p -h Binabik password 'Snowlock'

It works on a machine I just tested it with. YMMV.

Dave

You already have a root password set in the database, so you have to provide one to mysqladmin.

Code:
mysqladmin -u root -p -h localhost password 'your_new_password'

Give the current password (not the new one) when prompted the first time.

If that does not work, edit my.cnf, add skip-grant-tables, restart mysql, manually change your password, edit my.cnf and remove skip-grant-tables, restart mysql....
Back to top
View user's profile Send private message
p2cd3
Tux's lil' helper
Tux's lil' helper


Joined: 29 Apr 2004
Posts: 95

PostPosted: Thu Apr 20, 2006 9:32 pm    Post subject: Reply with quote

I did:

mysqladmin -u root -p -h localhost password 'your_new_password'

Binabik ~ # mysqladmin -u root -p -h localhost password 'gentoo'
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'

using new password, now I cannot access
mysql -u root -h localhost -p

can still access
mysql -u jack -h localhost -p

Where in my.cnf do I manually change the paswd for root?
Back to top
View user's profile Send private message
Bad Penguin
Guru
Guru


Joined: 18 Aug 2004
Posts: 507

PostPosted: Fri Apr 21, 2006 3:11 pm    Post subject: Reply with quote

p2cd3 wrote:
Where in my.cnf do I manually change the paswd for root?

I provided instructions in the post above...

Edit /etc/mysql/my.cnf and add or uncomment "skip-grant-tables". This will allow mysql to bypass any authentication whatsoever, so make sure nobody else can access your database while you are doing this!
Code:
skip-grant-tables


Stop/start mysql:
Code:
/etc/init.d/mysql stop
/etc/init.d/mysql start


Enter mysql and reset the password:
Code:

# mysql -u root -h localhost mysql
mysql> update user set password = password('your_new_root_password') where user='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0
mysql> quit


Edit /etc/mysql/my.cnf, remove skip-grant-tables.

Restart mysql.
Back to top
View user's profile Send private message
p2cd3
Tux's lil' helper
Tux's lil' helper


Joined: 29 Apr 2004
Posts: 95

PostPosted: Fri Apr 21, 2006 3:55 pm    Post subject: mysql configuration [SOLVED] Reply with quote

Bad Penguin, thanks very much, I now have root & jack back with the proper passwords[/topic]
Back to top
View user's profile Send private message
Bad Penguin
Guru
Guru


Joined: 18 Aug 2004
Posts: 507

PostPosted: Fri Apr 21, 2006 4:00 pm    Post subject: Re: mysql configuration [SOLVED] Reply with quote

p2cd3 wrote:
Bad Penguin, thanks very much, I now have root & jack back with the proper passwords[/topic]

That skip-grant-tables option is handy for development, but don't forget to turn it back off ;)
Back to top
View user's profile Send private message
netjunkie
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2005
Posts: 98

PostPosted: Mon May 08, 2006 11:03 pm    Post subject: Reply with quote

I have my DB working ok, and can connect to it from localhost.

How do I allow foreign hosts to connect to it, for example my PC running Mysql Administrator.

I get error 1045, unable to connect.

I have networking as follows:

my.cnf
Quote:

bind-address = 127.0.0.1
bind-address = 192.168.1.15




Myqlaccess.conf
Quote:

# ----------------#
# Global settings #
# --------------- #
#$Param{'host'} = '';
$Param{'user'} = 'root';
$Param{'db'} = 'test';
$Param{'password'} = 'mypass';
$Param{'debug'} = 0;

# --------------------------#
# Settings for Command-line #
# ------------------------- #
if ($CMD) {
$Param{'superuser'} = 'root';
$Param{'rhost'} = '192.168.1.11';
$Param{'spassword'} = 'mypass';
$Param{'brief'} = 1;
}

# ---------------------#
# Settings for CGI-BIN #
# -------------------- #
if ($CGI) {
$Param{'superuser'} = 'root';
$Param{'rhost'} = 'localhost';
$Param{'spassword'} = '';
$Param{'table'} = 1;
}

1; #to make require happy

_________________
Netjunkie
Gentoo - The ultimate learning tool for linux.

"Nobody trips over mountains. It is the small pebble that causes you to stumble. Pass all the pebbles in your path and you will find you have crossed the mountain."
-Traditional Proverb.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum