On 26/04/2008, at 6:56 PM, Carl Friis-Hansen wrote:
Karl Larsen wrote:
karl@karl-desktop:~$ mysqladmin -p secret version
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).
ubuntu-users mailing list
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users