mysql problem

Discussions Regarding Software

Moderator: Moderators

mysql problem

Postby deadfool » Thu May 15, 2008 19:48

i followed the gentoo wiki on installing mysql and when you do emerge --configure dev-db/mysql it breaks. i figured it wasnt a big dead so i try to connect to it and i get error 1045 error: 'Access denied for user 'root'@'localhost' (using password: YES)'

i tried it with a password and without one. and as my user, mysql and root. the password im trying i set in /etc/mysql/my.cnf so it should be right
deadfool
Growing Hen
 
Posts: 124
Joined: Thu Mar 27, 2008 3:56

Re: mysql problem

Postby xlnagla » Fri May 16, 2008 3:04

I think mysql uses the root password of your system if you install it the gentoo way, I remember having strange issues with this a couple years ago. Try that.

~xlnagla
xlnagla
Sagely Hen
 
Posts: 1078
Joined: Mon May 28, 2007 2:44

Re: mysql problem

Postby deadfool » Fri May 16, 2008 17:21

nope that didnt work.
deadfool
Growing Hen
 
Posts: 124
Joined: Thu Mar 27, 2008 3:56

Re: mysql problem

Postby xlnagla » Sat May 17, 2008 4:53

try using equo to re-install? Config should be auto through that. And throwing in a little bit of equo usually won't screw up portage - the reverse is annoying though.

~xlnagla
xlnagla
Sagely Hen
 
Posts: 1078
Joined: Mon May 28, 2007 2:44

Re: mysql problem

Postby deadfool » Sun May 18, 2008 20:35

xlnagla wrote:try using equo to re-install? Config should be auto through that. And throwing in a little bit of equo usually won't screw up portage - the reverse is annoying though.

~xlnagla


i originally installed it with equo and that didnt work so i did it the portage way. its weird
deadfool
Growing Hen
 
Posts: 124
Joined: Thu Mar 27, 2008 3:56

Re: mysql problem

Postby joost » Sun May 18, 2008 21:28

equo version works but maybe you are not able to read the signs?

Let me make it easy on you.

Code: Select all
localhost joost # equo install dev-db/mysql
>>  @@ Calculating dependencies...
>>  @@ Packages needing install:        1
>>  @@ Packages needing removal:   0
>>  @@ Download size:         0b
>>  @@ Freed disk space:      0.0b
>>  @@ You need at least:      35.7MB of free space
>>  :: (1/1) >>> dev-db/mysql-5.0.54
>>    ## Package checksum matches.
>>  ++ (1/1) >>> dev-db/mysql-5.0.54
>>    ## Unpacking package: dev-db:mysql-5.0.54~0.tbz2
--- Invalid atom in /etc/portage/package.use: -examples
>>    ## Ebuild: pkg_preinst()
>>    ## Installing package: dev-db/mysql-5.0.54 ## w/Gentoo compatibility
>>    ## Updating database: dev-db/mysql-5.0.54
>>    ## Ebuild: pkg_postinst()
dodoc: support-files/my-*.cnf does not exist
dodoc: support-files/magic does not exist
dodoc: support-files/ndb-config-2-node.ini does not exist
dodoc: scripts/mysql* does not exist
 *
 * You might want to run:
 * "emerge --config =dev-db/mysql-5.0.54"
 * if this is a new install.
 *
 * Berkeley DB support is deprecated and will be removed in future versions!
>>    ## Regenerating /etc/ld.so.cache
>>    ## Cleaning: dev-db/mysql-5.0.54
>>  @@ Install Complete.
>>  @@ Caching complete.
localhost joost # mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
localhost joost # /etc/init.d/mysql start
 * Starting  ...
 * MySQL datadir is empty or invalid
 * Please check your my.cnf : /etc/mysql/my.cnf                                                                                      [ !! ]
 * ERROR: mysql failed to start



Aha! We need to look in /etc/mysql/my.cnf and change the data dir:

Code: Select all
datadir                                         = /usr/lib/mysql


Code: Select all
localhost mysql # /etc/init.d/mysql start
 * Starting  ...
 * You don't appear to have the mysql database installed yet.
 * Please run /usr/bin/mysql_install_db to have this done...                                                                         [ !! ]
 * ERROR: mysql failed to start


/usr/bin/mysql_install_db ==> doesn't work... )o;

Ooohnoo! it still won't start, but wait yet more clues!

Lets hack it then!!

Code: Select all
$ /etc/init.d/mysql stop
$ mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
$ mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit;

Then kill the mysqld_safe, and restart mysql.

http://gentoo-wiki.com/HOWTO_MySQL
joost
Sagely Hen
 
Posts: 2566
Joined: Fri Nov 17, 2006 12:11
Location: The Netherlands

Re: mysql problem

Postby DontPanic » Wed May 21, 2008 17:33

This may be a long-shot, but I've seen the initial configuration on MySQL blow up because of not having a custom hostname.

If you haven't customized /etc/conf.d/hostname to something other than 'localhost', try that and see if it works.
Gigabyte GA-P35-DS3L - Intel(R) Core(TM)2 Duo CPU E6750@ 2.66GHz
nVidia GeForce 7600 GS
2 GB RAM
DontPanic
Old Dear Hen
 
Posts: 742
Joined: Mon Jul 09, 2007 20:29
Location: Mobile, AL, USA


Return to Software in General

Who is online

Users browsing this forum: No registered users and 1 guest