how to reset my root password in mysql docker image [closed] - mysql

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I am using MySQL image with docker, so when I want to get inside the MySQL by this command
docker exec -it mysql_1 MySQL -u root -p"
I have got an error below
"ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
and it seems to me that I have forgotten the password
Any suggestion would be appreciated.

First access your mysql container with this command
docker exec -it mysql_1 bash
or
docker exec -it mysql bash
then follow those steps to reset your root password for your mysql
https://linuxconfig.org/how-to-reset-mysql-root-password-on-your-linux-server

Related

connect to MySql installed in WSL from nodeJS [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 days ago.
Improve this question
I installed MySQL in Windows WSL. I created a user & DB with
CREATE USER admin#localhost IDENTIFIED BY 'admin';
GRANT ALL ON *.* TO admin#localhost;
CREATE DATABASE test;
From command line I can connect using admin with
sudo mysql -u admin -p
but without the sudo I get
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13)
With Workbench, I can connect to the test DB using admin/admin, but from NodeJS using mysql2 package (or Sequelize), I get Error: connect ECONNREFUSED ::1:3306
const mysql = require('mysql2/promise')
mysql.createConnection({ database: 'test', host: 'localhost', user: 'admin', password: 'admin' })
.then(console.log)
.catch(console.log)
Is sudo the problem? How can I connect from command-line or JS without sudo or see how Workbench does it?

Cannot remotely connect to mysql [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have tried pretty much everything I could read on SO. I cannot connect remotely to my sql server. I can't even telnet to the correct port (3306). The connection just hangs. Here is a list of what I've checked/tried:
1) Privileges in mysql
I've run CREATE USER 'test'#'%' IDENTIFIED BY 'pass'; followed by GRANT ALL PRIVILEGES ON db.* TO 'test'#'%';and I flushed the changes.
2) Editing my.cnf
I edited the line bind-addressto be 0.0.0.0. I have made sure that the port is default (3306) and restarted the mysql service.
3) Checked firewall / that the ports are open
Using netstat -tnlp I checked that mysql is listening to port 3306.
To be sure, I turned off the firewall (i assume...?) using sudo ufw disableĀ“, and ufw status` returns "inactive".
HOWEVER Despite all of the above, I still can't connect to my mysql server remotely. I have tried running mysql -u test -p -h xxx but after entering my password the connection just hangs and I get "unable to connect to remote host, connection timed out".
In addition, as mentioned above, I have attempted telnet xxxxx 3306 from another server (where the x's denote the server IP of course), and the connection also just times out/hangs.
If you have anything else for me to try I'd LOVE to hear it.
Thanks in advance

Which way is the best way to grant read access to a remote database-server? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have a question for you stackers. I'm not so well renowned with server maintenance and admin configuration. My problem is that I wan't to grant read access for a user to my mySQL databases on a remote server that's hosted by a server company.
I'm connecting via ssh to my server and then trying to create a new user for the databases in root -> mysql.
The problem I'm having is that I cannon't seem to connect to the databases from any other ip than as a localhost on the server itself. The bin-adress in my.cnf is pointing to localhost.
Is there another way to do this? Or rather how do you do this?
I really appreciate your answers.
Log in to your remote server via SSH
Open the the my.cnf file in an editor. (On Ubuntu that is located at
/etc/mysql/my.cnf): sudo vi /etc/mysql/my.cnf
Find the bind-address setting under the [mysqld] section and
change it from localhost to your the public IP address of your
server.
Save your edit.
Restart MySQL: sudo service mysql restart
Grant access to the remote user by logging into mysql as root and executing these commands (obviously you'll need to replace the IP address, database name and remote username with the correct values):
mysql -u root -p mysql
mysql> update db set Host='999.999.999.999' where Db='MyDB';
mysql> update user set Host='999.999.999.999' where user='RemoteUsername';
mysql> exit;
More information can be found on this page.

Can't seem to connect to mysql [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have the problem of connecting with mysql on my debian server. I run mysql -u root and get the error message:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
So I did and I ran the command sudo find / -type s and got
/run/proftpd.sock
/run/mysqld/mysqld.sock
Not /var/run/mysqld/mysqld.sock!
Im simply trying to set up a database server to test it. What should I do?
This question would be better asked on serverfault.com. However, the easiest way to do this (without confusing other Debian apps) would be to create (as root) a symbolic link to the sock file:
# ln -s /run/mysqld/mysqld.sock /var/run/mysqld/mysqld.sock
Connect with mysql -u root -S /run/mysqld/mysqld.sock, this should work.

Forgot mysql root password [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I forgot mysql root password. How can I get it again? I am trying to use mysql -u root command but I am getting this error ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
how can I solve this problem?
Try with -p option; then it will prompt you for password. In your case, it's saying that you can't access with user root with no password.
mysql -u root -h localhost -p
In case, you have really forgot your password then take a look here on how to reset the same
How to Reset the Root Password (for 5.7 version)