FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 04-25-2008, 11:44 PM
Karl Larsen
 
Default mysql problem

The apt-get install did get the mysql packages and installed them
properly. But my old book is not correct I think for this version 5.
When I try to get the version, or anything else with mysqladmin it does
this:

karl@karl-desktop:~$ mysqladmin -p secret version
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'karl'@'localhost' (using password: YES)'
karl@karl-desktop:~$

What have I done wrong? How do I get the mysql prompt?

Karl

--

Karl F. Larsen, AKA K5DI
Linux User
#450462 http://counter.li.org.
PGP 4208 4D6E 595F 22B9 FF1C ECB6 4A3C 2C54 FE23 53A7


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 04-25-2008, 11:55 PM
James Gray
 
Default mysql problem

On 26/04/2008, at 9:44 AM, Karl Larsen wrote:


The apt-get install did get the mysql packages and installed them
properly. But my old book is not correct I think for this version 5.
When I try to get the version, or anything else with mysqladmin it
does

this:

karl@karl-desktop:~$ mysqladmin -p secret version
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'karl'@'localhost' (using password:
YES)'

karl@karl-desktop:~$

What have I done wrong? How do I get the mysql prompt?


Try "sudo mysql" instead. IIRC the Ubuntu/Debian mysql server packages
don't set a root password on the MySQL instance by default.
Connecting as described earlier might get around this. It's been a
while since I installed MySQL on Ubuntu/Debian and I might be giving
you a bum steer, so apologies in advance if I do :P


Bottom line, "sudo mysql" can't hurt

Cheers,

James--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 04-26-2008, 12:12 AM
Karl Larsen
 
Default mysql problem

James Gray wrote:
>
> On 26/04/2008, at 9:44 AM, Karl Larsen wrote:
>
>> The apt-get install did get the mysql packages and installed them
>> properly. But my old book is not correct I think for this version 5.
>> When I try to get the version, or anything else with mysqladmin it does
>> this:
>>
>> karl@karl-desktop:~$ mysqladmin -p secret version
>> Enter password:
>> mysqladmin: connect to server at 'localhost' failed
>> error: 'Access denied for user 'karl'@'localhost' (using password: YES)'
>> karl@karl-desktop:~$
>>
>> What have I done wrong? How do I get the mysql prompt?
>
> Try "sudo mysql" instead. IIRC the Ubuntu/Debian mysql server packages
> don't set a root password on the MySQL instance by default.
> Connecting as described earlier might get around this. It's been a
> while since I installed MySQL on Ubuntu/Debian and I might be giving
> you a bum steer, so apologies in advance if I do :P
>
> Bottom line, "sudo mysql" can't hurt
>
> Cheers,
>
> James
Very good James it did work when I tried $ sudo mysql -p and it
asked for a password I gave while it was setting up. Now I have a:

karl@karl-desktop:~$ sudo mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 8
Server version: 5.0.45-Debian_1ubuntu3.3-log Debian etch distribution

Type 'help;' or 'h' for help. Type 'c' to clear the buffer.

mysql>

many thanks!

Karl


--

Karl F. Larsen, AKA K5DI
Linux User
#450462 http://counter.li.org.
PGP 4208 4D6E 595F 22B9 FF1C ECB6 4A3C 2C54 FE23 53A7


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 04-26-2008, 12:48 AM
James Gray
 
Default mysql problem

On 26/04/2008, at 10:12 AM, Karl Larsen wrote:


James Gray wrote:


On 26/04/2008, at 9:44 AM, Karl Larsen wrote:


The apt-get install did get the mysql packages and installed them
properly. But my old book is not correct I think for this version 5.
When I try to get the version, or anything else with mysqladmin it
does

this:

karl@karl-desktop:~$ mysqladmin -p secret version
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'karl'@'localhost' (using password:
YES)


-->8-- Snipped


Bottom line, "sudo mysql" can't hurt

Cheers,

James

Very good James it did work when I tried $ sudo mysql -p and it
asked for a password I gave while it was setting up. Now I have a:

karl@karl-desktop:~$ sudo mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 8
Server version: 5.0.45-Debian_1ubuntu3.3-log Debian etch distribution

Type 'help;' or 'h' for help. Type 'c' to clear the buffer.

mysql>

many thanks!


Awsome Glad I could help.

--
James--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 04-26-2008, 08:56 AM
Carl Friis-Hansen
 
Default mysql problem

Karl Larsen wrote:
>>> karl@karl-desktop:~$ mysqladmin -p secret version
Hi, Karl
normally you would *never* use sudo for this.
Instead tell the cilient what user you want to log in as.
In you case:
mysql -hlocalhost -uroot -p

--
+-------------------------------+-------------------+--------+
| Carl Friis-Hansen | Fiskeryd Nybygget | / |
| carl.friis-hansen@carl-fh.com | 341 91 Ljungby | / |
| Phone: +46 372 15033 | Sveden | ###### |
+-------------------------------+-------------------+--------+


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 04-26-2008, 09:09 AM
James Gray
 
Default mysql problem

On 26/04/2008, at 6:56 PM, Carl Friis-Hansen wrote:


Karl Larsen wrote:

karl@karl-desktop:~$ mysqladmin -p secret version

Hi, Karl
normally you would *never* use sudo for this.
Instead tell the cilient what user you want to log in as.
In you case:
mysql -hlocalhost -uroot -p


Yup - the reason I suggested using sudo was because in my experience
if there hasn't been a mysql "root" password set then you must be UID/
EUID zero in order to connect as "root' on mysql. So to kill 2 birds
with one stone, running "sudo mysql" does two things:

1. Tells mysql that you're attempting to connect as "root@localhost"
2. Sets your UID/EUID to zero.

If the OP hadn't set a mysql "root" password this method will get you
a root shell in mysql. If they HAVE set a root password, the mysql
client will prompt for one. In the latter case, you DON'T need to be
UID/EUID zero in order to login. Any user with the MySQL root user's
password can login by specifying "-u root" when running "mysql" on the
command line (provided the host they are connecting from has
permission to connect as "root").


Just thought that seeing as we're in the act of being precise, I'd
clarify the logic behind my instructions But you are most
definitely correct....as long as the user set the mysql "root"
password during installation. If they didn't, the "sudo mysql" method
usually works. Failing that, you need to bypass the grant tables on
start and set one manually (there's HEAPS of resources/how-to's/walk-
throughs on how to accomplish this on the 'net).


Cheers,

James

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 04-26-2008, 09:54 AM
Res
 
Default mysql problem

On Sat, 26 Apr 2008, James Gray wrote:

> running "sudo mysql" does two things:

The fact you give a valid shell to a daemon is rather scary



--
Cheers
Res

I read usenet and lists in pine. But m$ outlook, thunderbird and gmail
often use html span/whatever for quotes, makes it hard to tell who said
what, so I dont try. If I ignore you, thats why! Use a compliant mailer.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 04-26-2008, 11:37 AM
Carl Friis-Hansen
 
Default mysql problem

Res wrote:
>> running "sudo mysql" does two things:
>
> The fact you give a valid shell to a daemon is rather scary
I totally agree. It looks like James has come about a problem in the
past, but as far as I know the mysql or the mysqladmin doesn't really
care who runs it. However, if -u is not given on command line, then it
assumes the user who invoked the shell and passes this on to the
database server. The database server on the other hand has no knowledge
of any user ID in Linux, Mac or Windows, it uses Host, User and Password
to compare against values in mysql.user table.

--
+-------------------------------+-------------------+--------+
| Carl Friis-Hansen | Fiskeryd Nybygget | / |
| carl.friis-hansen@carl-fh.com | 341 91 Ljungby | / |
| Phone: +46 372 15033 | Sveden | ###### |
+-------------------------------+-------------------+--------+


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 04-26-2008, 11:53 AM
Avi Greenbury
 
Default mysql problem

On Sat, 26 Apr 2008 09:55:11 +1000
James Gray <james@gray.net.au> wrote:
>
> Bottom line, "sudo mysql" can't hurt
>

No, it can.

Unless an app _needs_ root privileges (and MySQL doesn't) there's no reason to run it as root, and good reasons not to.


--
Avi Greenbury

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 04-26-2008, 01:15 PM
Karl Larsen
 
Default mysql problem

Carl Friis-Hansen wrote:
> Karl Larsen wrote:
>
>>>> karl@karl-desktop:~$ mysqladmin -p secret version
>>>>
> Hi, Karl
> normally you would *never* use sudo for this.
> Instead tell the cilient what user you want to log in as.
> In you case:
> mysql -hlocalhost -uroot -p
>
>
Hi Carl, my problem was I thought like you are and I put too much
information in the command line. As I understand now, MySQL reads the
user name from the terminal and then asked for the password. So I need
to be a root user to use that password. I also have another user set up
from my normal user "karl" and that works too. You need to let the
system know who is calling on localhost. I have no idea how they get it
working on Windows :-)

Karl


--

Karl F. Larsen, AKA K5DI
Linux User
#450462 http://counter.li.org.
PGP 4208 4D6E 595F 22B9 FF1C ECB6 4A3C 2C54 FE23 53A7


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 09:12 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org