install mysql 5.7 without root password - mysql

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

Related

Can't connect to MySQL using SequelPro

I have recently installed MySQL 5.7.16 on an iMac running El Capitan. I had a few minor hiccups initially because I forgot the root password but that has now been reset and I can now log into MySQL as root user using:
$ mysql -u root -p
However, when I try to connect to MySQL server as root using SequelPro, I get the message:
Unable to connect via the socket, or the request timed out.
Double-check that the socket path is correct and that you have the necessary privileges, and that the server is running.
MySQL said: Your password has expired. To log in you must change it using a client that supports expired passwords.
When I look in /tmp folder, I was expecting to find mysql.sock but, instead, there is a file called mysql.sock.lock. Could this be causing the problem? I can't find where that .lock file has come from and I'm not sure what to do about it. Any help would be appreciated.
I'm not entirely sure what happened to cause the root password to expire but something had thrown a spanner in the works. Anyway, the solution for me was to log into MySQL from the Terminal using:
$ mysql -u root -p
...and then alter the root user's password using:
> ALTER USER 'root'#'localhost' IDENTIFIED BY 'NewPass';
That seemed to do the trick. I was then able to log in to MySQL using Sequel Pro with no problems.
Instead of using a socket connection, you could try connecting via Sequel Pro's standard connection using 127.0.0.1 as the host.
Thus spake the 5.7 docs:
The installation process creates only a single root account, 'root'#'localhost', automatically generates a random password for this account, and marks the password expired. The MySQL administrator must connect as root using the random password and assign a new password. (The server writes the random password to the error log.)
So, connect from terminal and change the root password.
Either your first password may not have been saved OR it just truly never persisted.
For me it was the sudo /usr/local/bin/mysql_secure_installation that may not have ever persisted the password correctly. Since your first password never changed, there is no password or ,like your error said, "expired" to nothing.
Run or rerun the code above, don't type anything for the password field and follow the steps, from the preloaded setup program.

MySQL command prompt doesnt require password

I have installed MySQL on my machine. I can log in by directly opening the MySQL 5.6 command line client from the start menu and it prompts me for my password. When I enter the correct password it lets me in, and if it's wrong, it kicks me out.
When I run MySQL from the command prompt, the ONLY way I can log in (using both root user or another user I have created) is to enter no password. If I enter my password it says access denied to root#localhost... yada yada ... using password:YES
so in summary if i type
mysql -u root -p
password: [mypassword]
it doesn't work, throwing the error Access denied, using password yes
However, if I do
mysql -u root -p
password: [blank]
it logs in. same behavior for any other user.
That makes no sense to me cause in every other application I have to enter a password to get in.
any ideas?
This is because the user root has no password by default unless specified during installation. Trying to login with a password is impossible if there is no password.

MySQL Connection Error on Apache Port 8080

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.

mysql access denied for user 'odbc'#'localhost' to database

I installed MySql5.5 and set password during installation but when I try to use mysql from windows command prompt, I have get the error:
access denied for user 'odbc'#'localhost' to database password = 'YES'
I would like to change it back into "root#localhost" as well as to reset the password but I can't log in mysql.
How do I login to mysql with root?
You're trying to use the mysql interactive shell? You can specify usernames at the command line:
c:\> mysql -u root -p
where
-u = specify username
-p = prompt for password
I fixed this by implementing a little hacky solution. Downloaded hxd (hex editor) and searched for 'ODBC' (there should only be one match) and just changed it to 'root'.
You are logging into mysql with a default no-rights user, you have to login as root if you want to do everything:
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql.exe -u root -p
Enter Password: *****
If you never specified a root password it should be blank, if you did, you have to remember what it was, or find out how to reset the root password.

Can't Connect to LocalHost Mysql Server

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