Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: MySQL - error #1045 cannot connect...

  1. #1
    Join Date
    Mar 2008
    Location
    UK
    Beans
    279
    Distro
    Ubuntu 12.04 Precise Pangolin

    MySQL - error #1045 Access Denied for user root@localhost

    Hello all,

    I am running apache2 and php under ubuntu 8.04 DESKTOP edition, anyway,

    I'm trying to setup mysql, yet everytime I try to connect to it using mysql admin it says this:

    'Unable to connect to server at localhost using root@localhost, check for connection errors.'

    I'm using the mysql default root user, in the install I left the password field empty.

    Its mySQL 5
    I have reinstalled it 3 times (complete remove) first time i put a password in the dialog, second time i did and third time I didn't.

    All yeilding the same result

    Please Help Someone!

    Yours sincerely,
    GCoffee.
    Last edited by GCoffee; May 3rd, 2008 at 10:35 AM.
    GCoffee.

  2. #2
    Join Date
    Mar 2008
    Location
    UK
    Beans
    279
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: MySQL - error #1045 cannot connect...

    Anyone? Please?

    I am trying to run a phpbb installstion but need mysql to do so. Please help!
    GCoffee.

  3. #3
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Beans
    1,393
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: MySQL - error #1045 cannot connect...

    Quote Originally Posted by GCoffee View Post
    Anyone? Please?

    I am trying to run a phpbb installstion but need mysql to do so. Please help!
    What is the exact error you receive if you go to a terminal session and do the following?

    Code:
    mysql -u root

  4. #4
    Join Date
    Mar 2008
    Location
    UK
    Beans
    279
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: MySQL - error #1045 cannot connect...

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

    Error I get when i run mysql -u root
    GCoffee.

  5. #5
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Beans
    1,393
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: MySQL - error #1045 cannot connect...

    Quote Originally Posted by GCoffee View Post
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

    Error I get when i run mysql -u root

    Sounds like mysqld may not even be running.

    Do this:

    Code:
    sudo netstat -anltp | grep 3306

    You should see similar the following:

    Code:
    tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      4985/mysqld
    If you don't see mysqld at all when you run that command:

    Code:
    sudo /etc/init.d/mysql start

  6. #6
    Join Date
    Mar 2008
    Location
    UK
    Beans
    279
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: MySQL - error #1045 cannot connect...

    df: `/var/lib/mysql/.': No such file or directory
    df: no file systems processed
    * /etc/init.d/mysql: ERROR: The partition with /var/lib/mysql is too full!

    Thats what I get when running the last command you suggested,

    Strange because ubuntu is on a 80GB partition, and only 10gb been used..
    GCoffee.

  7. #7
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Beans
    1,393
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: MySQL - error #1045 cannot connect...

    When there are problems, the mysql logs can contain quite a bit of info and consume a lot of space.


    What are the results of the following commands?

    Code:
    df -h
    sudo du -ch --max-depth=1 /
    sudo du -ch --max-depth=1 /var/lib

  8. #8
    Join Date
    Mar 2008
    Location
    UK
    Beans
    279
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: MySQL - error #1045 cannot connect...

    df -h:

    Filesystem Size Used Avail Use% Mounted on
    dev/sda3 74G 3.3G 67G 5% /
    varrun 251M 108K 251M 1% /var/run
    varlock 251M 0 251M 0% /var/lock
    udev 251M 56K 251M 1% /dev
    devshm 251M 12K 251M 1% /dev/shm
    lrm 251M 38M 214M 15% /lib/modules/2.6.24-16-generic/volatile
    /dev/sda1 81G 7.6G 73G 10% /media/sda1
    /dev/sda4 7.5G 3.5G 3.7G 49% /media/sda4
    gvfs-fuse-daemon 74G 3.3G 67G 5% /home/joe/.gvfs
    /dev/sdb1 984M 109M 875M 12% /media/joes DATA 2


    sudo du -ch --max-depth=1 /:

    joe@localhost:~$ sudo du -ch --max-depth=1 /
    [sudo] password for joe:
    14M /etc
    280M /lib
    du: cannot access `/home/joe/.gvfs': Permission denied
    171M /home
    7.4M /root
    4.0K /opt
    80K /dev
    5.2M /bin
    11G /media
    0 /sys
    2.0G /usr
    4.0K /mnt
    du: cannot access `/proc/6629/task/6629/fd/4': No such file or directory
    du: cannot access `/proc/6629/task/6629/fdinfo/4': No such file or directory
    du: cannot access `/proc/6629/fd/4': No such file or directory
    du: cannot access `/proc/6629/fdinfo/4': No such file or directory
    0 /proc
    6.4M /sbin
    104K /tmp
    730M /var
    16K /lost+found
    36M /boot
    4.0K /srv
    4.0K /initrd
    14G /
    14G total

    sudo du -ch --max-depth=1 /var/lib:

    [sudo] password for joe:
    4.0K /var/lib/gnome-session
    12K /var/lib/mozilla-firefox
    4.0K /var/lib/aptitude
    176K /var/lib/misc
    4.0K /var/lib/guidance-backends
    8.0K /var/lib/dovecot
    8.0K /var/lib/urandom
    4.0K /var/lib/avahi-autoipd
    16K /var/lib/locales
    4.0K /var/lib/update-manager
    29M /var/lib/apt
    12K /var/lib/ufw
    8.0K /var/lib/vim
    4.0K /var/lib/sgml-base
    8.0K /var/lib/hal
    36K /var/lib/dictionaries-common
    28K /var/lib/gdm
    39M /var/lib/dpkg
    2.5M /var/lib/mlocate
    8.0K /var/lib/logrotate
    4.0K /var/lib/apparmor
    4.0K /var/lib/PolicyKit-public
    4.0K /var/lib/initscripts
    5.1M /var/lib/python-support
    16K /var/lib/alsa
    8.0K /var/lib/PolicyKit
    4.0K /var/lib/snmp
    24K /var/lib/php5
    4.0K /var/lib/NetworkManager
    3.5M /var/lib/aspell
    172K /var/lib/ucf
    52K /var/lib/belocs
    380K /var/lib/doc-base
    12K /var/lib/initramfs-tools
    8.0K /var/lib/phpmyadmin
    8.0K /var/lib/dbus
    4.0K /var/lib/mod_bt
    8.0K /var/lib/update-notifier
    24K /var/lib/acpi-support
    32K /var/lib/xml-core
    1.7M /var/lib/defoma
    4.0K /var/lib/libuuid
    24K /var/lib/x11
    4.0K /var/lib/mysql-cluster
    62M /var/lib/gconf
    12K /var/lib/thunderbird
    4.0K /var/lib/xkb
    21M /var/lib/scrollkeeper
    8.0K /var/lib/displayconfig-gtk
    8.0K /var/lib/dhcp3
    4.0K /var/lib/synaptic
    164M /var/lib
    164M total

    NOTE: joe is not my actual user name..
    GCoffee.

  9. #9
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Beans
    1,393
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: MySQL - error #1045 cannot connect...

    Weird. That one error message was right, you do not have a /var/lib/mysql directory. That is the default directory where all the database and log files are kept. By any chance did you manually remove the mysql directory before reinstalling?


    Do this:

    Code:
    sudo mkdir /var/lib/mysql
    sudo chown mysql.mysql /var/lib/mysql
    sudo /etc/init.d/mysql start

    Then try to connect again from the terminal.

  10. #10
    Join Date
    Mar 2008
    Location
    UK
    Beans
    279
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: MySQL - error #1045 cannot connect...

    All went well, then this occured: * Starting MySQL database server mysqld [fail]
    GCoffee.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •