Im a newbie in ubuntu. Im getting an error while installing phpmyadmin in ubuntu11.4 server. It says
An error occurred while installing the database:
ERROR 1045 (28000):Access denaid for user 'root'#'localhost' (using password:YES);
I am sure that I used the correct password for root. I can login to mysql through putty.
Do I need to do anything with privileges?
Please help me to sort this issue.
I suggest:
mysql -h localhost -u root -p
and you typed something else. :(
pidof mysqld says what exactly? If nothing then sudo service mysql start and try
mysql -h localhost -u root -p
again.
Re-configure mysql-server:
sudo dpkg-reconfigure mysql-server
or
sudo dpkg-reconfigure mysql-server-5.1
whichever one is installed.
Once you reconfigure (and recover) your root mysql password, then
Reconfigure phpmyadmin
sudo dpkg-reconfigure phpmyadmin
i ran into the same issue and just figured my problem. I used an "ΓΌ" in my Root user's password. It seems like PHPMYADMIN can't handle the utf-8 set. So I altered the password to "abc" and it worked! Just dont forget to undo your temporary password :)
I got the same issue and installed my machine again, because I though I did something wrong. But same problem after re-installation of Ubuntu.
What works for me is to install mysql-server and phpmyadmin NOT as root user. I create a new user adduser admin and put them into the sudo group with adduser admin sudo. After that, I exit my ssh-connection with the root-account and login with the new admin-user. Now, I install both software-bundles and, suprise, all works fine.
Related
am trying to deploy a website on a new server I install MYSQL using the command
sudo apt-get install mysql-server
After that I try to access the MYSQL command prompt using the command
sudo mysql -u root -p
it is giving me the error:
Access denied for user 'root'#'localhost' using password(NO).
Any idea on how to solve this? thanks!!
you have first to run
sudo mysql_secure_installation
after that you should have entered a password for root and the server is configured.
You can also use after that
sudo mysql
to get access with administrator rights and change passwords or add new users
The mysql command - which is the MySQL client library - doesn't require root privileges.
You should run it without sudo:
mysql -u root -p.
Then you should be asked to enter the password. As the docs say, the password should be known to you:
For installations using the MySQL APT repository or Debian packages directly downloaded from Oracle, you should have already assigned the root password yourself.
I have tried to install mysql, and then to run with
mysql -u root -p
but I get
ERROR 1698 (28000): Access denied for user 'root'#'localhost'
I can get in with sudo, but I don't want to run as root. How do I get to run mysql as non-root?
I am using Linux Mint 19.1 32-bit.
What I tried:
sudo apt-get install mysql-client
sudo apt-get install mysql-server
sudo /etc/init.d/mysql restart
sudo mysql_secure_installation
Set up VALIDATE PASSWORD? No
Remove anonymous users? No
Disallow root login remotely? Yes
Remove test database and access to it? No
Reload privilege tables now? Yes
Then I try
mysql -u root -p
it asks for the password, I give the same one I gave in mysql_secure_installation...
frank#frank-laptop:~/WebDev$ mysql -u root -p
Enter password:
ERROR 1698 (28000): Access denied for user 'root'#'localhost'
Gah.
I have reinstalled mysql client and server several times now, doing a complete uninstall between and getting rid of all databases when asked. I don't get asked for a root password during the install. That seems to be normal for an install in Ubuntu and derivatives, hence the mysql_secure_installation to set the password.
I tried following
http://www.yolinux.com/TUTORIALS/LinuxTutorialMySQL.html
I tried searching on the web for hints, e.g.
https://askubuntu.com/questions/766900/mysql-doesnt-ask-for-root-password-when-installing#766908
and others but I have not been able to get mysql to start without sudo. If I do use sudo I can create a database, add tables and add data so the database is installed, I just need more privilege to run it than I think I should need.
Anywhere I looked, the instructions go from installation to starting mysql without anything special between, so I think I must be doing something quite stupid. But I have not been able to figure out what.
The first time you run mysql -u root -p , you have to run it with sudo in order to create a new user:
DROP USER 'root'#'localhost';
CREATE USER 'XXX'#'%' IDENTIFIED BY 'YYY';
GRANT ALL PRIVILEGES ON *.* TO 'XXX'#'%' WITH GRANT OPTION;
Then you can connect yourself using mysql --user=XXX --password=YYY
I already try but I don't think you can setup your DB without using sudo unfortunately.
I want to build a LAMP Web Server with WordPress using a Raspberry-Pi 3 and I have followed this tutorial:
https://projects.raspberrypi.org/en/projects/lamp-web-server-with-wordpress
I am having some problems with MySQL installation, because using the command
$ sudo apt-get install mysql-server php-mysql -y
I can't select the root password, as written in the tutorial. Then, I am not able to enter the MySQL database with command
$ mysql -uroot -ppassword
neither using
$ mysql -uroot -p
The only way to enter the database is to use (without any password)
$ sudo mysql -uroot
In the last step of tutorial, when I have to select the database connection details, I don't know which password to use.
Can anyone help me?
Thank you!
There are two "roots".
The password for the OS's root is used for sudo.
The password for MySQL's root is used for mysql -u root -p.
There should be no need for sudo mysql .... But when you do it, first the OS has control and either remembers that you are sudo, or prompts something like
[sudo] password for root:
Then mysql gets control and sees the -p, so prompts you:
Enter password:
During the setup, were you ever asked to create a mysql root password? If not, then mysql -uroot would get into mysql without a password. You should create a password then for security.
This is possibly caused by the change that Debian did to MariaDB. They enabled the UNIX socket authentication plugin by default for newer versions. This would explain why no password is required.
If you want to enable password authentication, you could create a separate root user account. This appears to be required to complete the tutorial.
CREATE USER 'root'#'127.0.0.1' IDENTIFIED BY 'my-password';
This creates the user root with the password my-password which you can then add to the WordPress configuration.
I downloaded MySQL 5.7.17 for Mac and installed it. I can start and stop the SQL server from my Preferences > MySQL. It is shown as an instance on port 3306 from Workbench so all that seems fine. However, during install toward the end a pop-up window listed a password I was supposed to use. I assumed it would be promptly needed so copied on the clipboard. Few mins later having not been prompted for it yet, I copied something else in the clipboard thus losing it.
I have been trying to get some sort of client of mysql command line so I can enter sql commands, however there is no "Application" installed to use to access the server. I have scoured the MySQL documentation and Stack and beyond, and searched for how to get the password reset, and a mysql client/command line, but all the articles seem to assume you already have access to a "MySQL terminal"/"command line". I only have access to my normal Mac Terminal, and most commands in the normal Terminal window either fail or require the password I don't have, for example:
$ mysqld --skip-grant-tables
-bash: mysqld: command not found
$ mysql -u root -p
-bash: mysql: command not found
$ sudo sh -c 'echo /usr/local/mysql/bin > /etc/paths.d/mysql'
Password: (this is probably the password I was given that got overwritten? When I try the admin password of the machine it sends me back to the prompt)
$ sudo mysqld_safe --skip-grant-tables (after I'd stopped the server)
sudo: mysqld_safe: command not found
Can somebody please help me figure out how to get to a "MySql Terminal" and if I need this password that got overwritten, how to reset it? (it seems like uninstalling MySQL to repeat the steps and this time take better care of the password is actually horrendously difficult / no uninstall protocol?).
Thank you so very much.
--- Update: I used the How To Uninstall suggested by Josh M and then re-installed. This time I saved the password (so far, not sure how / where I need to use it). However, I must really be missing something b/c I still can't get access to mysql.
/usr/local/mysql/bin/mysql
ERROR 1045 (28000): Access denied for user 'Robert'#'localhost' (using password: NO)
Then I did $ export PATH=$PATH:/usr/local/mysql/bin but I still get ERROR 1045.
Try these set of commands
$ sudo /usr/local/mysql/support-files/mysql.server stop
$ sudo /usr/local/mysql/support-files/mysql.server start --skip-grant-tables
/usr/local/mysql/bin/mysql
FLUSH PRIVILEGES;
ALTER USER 'root'#'localhost' IDENTIFIED BY 'YOUR_NEW_PASSWORD';
EXIT;
$ sudo /usr/local/mysql/support-files/mysql.server stop
$ sudo /usr/local/mysql/support-files/mysql.server start
$ mysql -u root -p
$ Enter Password: ππ» ENTER_YOUR_NEW_PASSWORD_HERE ππ»
And enjoy π
There's a tutorial for resetting passwords here: https://www.howtoforge.com/setting-changing-resetting-mysql-root-passwords
Your MySQL command line interface (cli) is probably at:
/usr/local/mysql/bin/mysql
Honestly it might be better to reinstall. There's an SO on that: How do you uninstall MySQL from Mac OS X?
Today (2015-05-02) I upgraded my Linux system via apt-get update and
apt-get upgrade whereas mysql, mysqladmin and a lot more packages
have been updated. The mysql-server-5.5 runs and I can login and do all
the typical database operations but when I type:
user#ubuntu:~# mysqladmin proc
I get the following error:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'#'localhost' (using password: NO)'
Formerly I could solve this issue by simple setting the mysql root password new.
This does not solve the issue anymore:
user#ubuntu:~# sudo dpkg-reconfigure mysql-server-5.5
How do I get the mysqladmin up again without reinstalling mysql?
Short version: If your MySQL user root needs a password to connect, it might be a good idea to have mysqladmin provide that password ;)
Longer version: Your MySQL user root seems to need a password to connect
setting the mysql root password new
But mysqladmin tries to connect without a password
'Access denied for user 'root'#'localhost' (using password: NO)'
And mysqladmin does that because you're not telling it otherwise ;)
mysqladmin, like other MySQL-related command line tools (mysql, mysqldump, mysqlshow etc.), offers options to provide such access data.
h: Which host to connect to. If not provided, localhost is assumed
u: Which user to connect as. If not provided, root is assumed
p: Which password to use. If not provided, no password is used
You should be able to use something like
mysqladmin -uroot -pmysupersecretpassword proc
(be aware that there's no space between the options and their values). You can also have MySQL ask you for the password like
mysqladmin -uroot -p proc
With that, MySQL should give you a prompt where you can enter your password.
Everything is going good and fine except for being able to get MySQL to work, Everything was working fine except status was failed.
MySQL Service Status
Try this if you are working in fedora 3x
sudo rm -rf /var/lib/mysql
sudo dnf install community-mysql-server
sudo systemctl start mysqld.service
After this try
sudo dnf reinstall community-mysql-server