I am running IIS on default port and Apache on 8080 on Windows 2000 server. Both run fine, however, I am unable to establish connection to the MySQL server. It gives me the following error
Access denied for user 'root#localhost' < using password: YES >
I am pretty sure am using the right password. My question is do I need to change MySQL configuration settings since am using Apache on a different port ?
Try reseting the password. Open a console and type:
mysqladmin -u root password your-new-password
mysql -u root -p
Then you'll be prompted to input the new password.
The root user has a default password which is an empty space. At times this causes connection problems.
I would recommend that you create a user other than the root, and ensure that they have a password then you can use the new username and password instead.
Related
I'm facing some issue when installation in MySQL-Server. I tried to change the root password several times but it does not work as I expected. Finally when I'm going to change the password It's shows like this kind of output. How can I resolve this problem. When I going to connect to the sql database using netbeans it's output shows this error.
Cannot establish a connection to jdbc:mysql://localhost:3306/mysql?zeroDateTimeBehavior=CONVERT_TO_NULL using com.mysql.cj.jdbc.Driver (Access denied for user 'root'#'localhost')
mysql > select user, authentication_string plugin from mysql.user;
I think that you have correct password, but NetBeans cannot connect to TCP port 3306 at all. As soon as JDBC driver cannot connect to unix socket, please try to bind MySQL Server to tcp port 3306.
I think that it will be enough to check your MySQL configuration and find "skip-networking" option and remove it.
Please check /etc/my.cnf.d directory and /etc/my.cnf file for this line, delete it and restart MySQL server.
If you need to change the root password, the easiest way is to run mysql_secure_installation script from root user.
This is the error message I got after I tried to make a password and username for localhost and root. Please help me. I am using Mac by the way.
MySQL said: Documentation
Cannot connect: invalid settings.
mysqli::real_connect(): (HY000/1045): Access denied for user 'root'#'localhost' (using password: NO)
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
go to xampp\mysql\bin\my.ini and open it. change the port to 3307
and go to xampp\phpMyAdmin\config.inc.php and check the name of the host
$cfg['Servers'][$i]['host'] = 'localhost:3307';
Adding to soufiane's answer above, there is actually 2 more places where you have to make the same change:
xampp window: config > Service and Port Settings > mysql > Change port to 3307
add $cfg['Servers'][$i]['port'] = 3307; to phpMyAdmin\config.inc.php
For a complete start to finish solution, refer to this answer on Quora by Owais R. Mir: https://www.quora.com/How-do-I-change-the-port-of-a-MySQL-server-in-XAMPP/answer/Owais-R-Mir
PS:
I used this solution to run mysql from xampp on port 3307 because I had installed mysql separately before and it was using port 3306. When ports are reset for xampp mysql you avoid issues with initializing and signing in to your local database via phpmyadmin.
trying to install mysql 5.7 i get the prompt for a root password.
after pressing enter i assume that the password for the root user will just be blank (null?)
if i try to connect to the server with mysql -u root the connection can't be established due to wrong authentication. if i add the -p parameter to get the prompt and leaving that empty will also result in bad authentication.
i'm not sure if can i completely remove the root password for mysql.
What system user are you connecting from ?
If you don't provide a root password during installation, it does not just set an empty password, it refuses any password, and only the system root user can connect, just by typing :
mysql
I downloaded and installed mysql community server GPL version 5.7.13 on my Mac OSX El Capitan. Then I downloaded sequel pro. I tried to connect mysql using socket. I used the name localhost and username root and kept the password blank. When I tried to connect every time I got the message in the picture.
I also want to add, when I install mysql for the first time, there is a popup which gives me a cryptic password for the root#localhost. So instead of keeping the password section blank, I tried that password too. But it kept showing me the same message except 'root'#'localhost' (using password: YES). What am I doing wrong?
Start mysql server in terminal by:
mysql.server start
Access in mysql with your root user (deffault user created when installed mysql)
mysql -uroot
Create a new account by:
CREATE USER 'new_user'#'localhost' IDENTIFIED BY 'new_password';
Give it all privileges:
GRANT ALL PRIVILEGES ON * . * TO 'new_user'#'localhost';
Then to reload newly assigned permissions run:
FLUSH PRIVILEGES;
Now you should be able to connect with Sequel Pro with new user:
Standard
Host: 127.0.0.1
Username: new_user
Password: new_password
I use Sequel Pro and connect without password to a localhost server via socket, without any problems. The most likely problem is you typed in the wrong root password. You can reset the root password.
Make sure MySQL is running (start MAMP/XAMP servers)
MAMP uses "root" for the username AND "root" for the password
Use 127.0.0.1 instead of 'localhost'.
Uninstall it and again install. Give the root password at the time of installation. It worked for me.
You will need to restart mysql after changing password, password can be and is in many cases blank, empty carriage return.
the easiest way to restart mysql I have found is by command line
mysql restart;
I recently installed mysql server and client, but I can't connect to the server. I get this message:
Access denied for user 'root'#'localhost' (using password: YES/NO)
Whatever I do i will always get the same message.
I tried commenting bind-address but still the same thing.
If you set up a password for the root user during installation, then start the mysql client with the -p option, mysql -u root -p, and it should prompt you for a password.
If there's no password set, leave the -p off and it should log right in.
If you've somehow forgotten what the root password is, you can fix it by following these instructions... http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html