View previous topic :: View next topic |
Author |
Message |
p2cd3 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 29 Apr 2004 Posts: 95
|
Posted: Wed Apr 19, 2006 8:53 pm Post subject: mysql configuration |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
kashani Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/9629732313ee51df8c5935.jpg)
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Wed Apr 19, 2006 10:43 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
p2cd3 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 29 Apr 2004 Posts: 95
|
Posted: Thu Apr 20, 2006 4:30 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
think4urs11 Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/8534934054bad29b51e5fa.jpg)
Joined: 25 Jun 2003 Posts: 6659 Location: above the cloud
|
Posted: Thu Apr 20, 2006 4:54 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
p2cd3 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 29 Apr 2004 Posts: 95
|
Posted: Thu Apr 20, 2006 5:03 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
wizard69 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/gallery/Marvel/movie_x-men_wolverine.gif)
Joined: 22 Sep 2003 Posts: 178 Location: Berlin
|
Posted: Thu Apr 20, 2006 11:39 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
DaveArb Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 29 Apr 2004 Posts: 510 Location: Texas, USA
|
Posted: Thu Apr 20, 2006 2:11 pm Post subject: Re: mysql configuration |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
p2cd3 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 29 Apr 2004 Posts: 95
|
Posted: Thu Apr 20, 2006 2:31 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
p2cd3 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 29 Apr 2004 Posts: 95
|
Posted: Thu Apr 20, 2006 2:39 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Corax Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/gallery/Loony Toons/Looney_Toons_-_Daffy.gif)
Joined: 14 Apr 2004 Posts: 222 Location: Berlin, Germany
|
Posted: Thu Apr 20, 2006 2:43 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
DaveArb Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 29 Apr 2004 Posts: 510 Location: Texas, USA
|
Posted: Thu Apr 20, 2006 3:07 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
p2cd3 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 29 Apr 2004 Posts: 95
|
Posted: Thu Apr 20, 2006 3:39 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Bad Penguin Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/14405804604419c4f7bf468.png)
Joined: 18 Aug 2004 Posts: 507
|
Posted: Thu Apr 20, 2006 6:54 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
p2cd3 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 29 Apr 2004 Posts: 95
|
Posted: Thu Apr 20, 2006 9:32 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Bad Penguin Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/14405804604419c4f7bf468.png)
Joined: 18 Aug 2004 Posts: 507
|
Posted: Fri Apr 21, 2006 3:11 pm Post subject: |
|
|
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!
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 |
|
![](templates/gentoo/images/spacer.gif) |
p2cd3 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 29 Apr 2004 Posts: 95
|
Posted: Fri Apr 21, 2006 3:55 pm Post subject: mysql configuration [SOLVED] |
|
|
Bad Penguin, thanks very much, I now have root & jack back with the proper passwords[/topic] |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Bad Penguin Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/14405804604419c4f7bf468.png)
Joined: 18 Aug 2004 Posts: 507
|
Posted: Fri Apr 21, 2006 4:00 pm Post subject: Re: mysql configuration [SOLVED] |
|
|
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 ![Wink ;)](images/smiles/icon_wink.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
netjunkie Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/gallery/TV Stars/daniel1.jpg)
Joined: 03 May 2005 Posts: 98
|
Posted: Mon May 08, 2006 11:03 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|