I'm getting crazy over this issue, I hope someone can help me:
I created an Azure Database for MySQL server
Disabled SSL, and allowed all IPs to access
Trying to connect to the server using Server name and Server admin login name
I tried MySQLWorkbench, and CLI mysql -u <Server admin login name> -h <Server name> -P 3306 -p
In both cases it freezes, no error messages, doesn't timeout, no logs on the azure side.
I have literally no idea what's wrong or what to do about it. The database was just created, totally untouched.
Has anyone experiences something similar before?
Thank you!
With the given information it's not clear what is the exact error while accessing the database, but if you have deployed it properly you can access it easily without any error using both, MySQL Workbench and CLI.
In your example, the sequence of parameter isn't in write format which might giving issue.
Try below format:
mysql -h <server_name>.mysql.database.azure.com -u <admin_name>#<server_name> -p
If using MySQL Workbench, you can refer official document Use MySQL Workbench to connect and query data in Azure Database for MySQL for the same.
This should work.
Related
I am quite stressed, I am afraid I have lost my databases. I wanted to access my database from another laptop, but I finally lost the connection to my databases, and when I found it again, my databases were gone.
I hope you will be able to help me or perhaps have some encouraging leads.
I wanted to access my database from another laptop, so I tried to change my hostname from "localhost" to my IP address on MySQL Workbench. This way I could not connect to MySQL, I tried to change my hostname back to "localhost" but I could not connect either.
Finally, since I'm on a Mac, I went to System Preferences > MySQL > Initialize Database, and changed to use legacy password encryption, as suggested in a tutorial. Then I can connect to the server, but there are none of my databases, just the original "syst" database.
Are you able to connect to your MySQL via command:
mysql -u username -ppassword (no interval after -p)
(bear in mind that you have to be in the bin dir of MySQL) for example using XAMPP in cmd, I can connect via the following commands:
cd C:\xampp\mysq\bin
mysql -u root -ppassword
If you are able to connect try to reach the database via command line like this:
mysql -u username -ppassword --execute="select * from databasename.table"
or just some other query just to check if the database is still there.
This should be done on the PC(or server) where the MYSQL is installed.
If this is working you can manage to fix the issues.
I have a MySQL database on Azure, using the Azure managed database service, and two Ubuntu 20.04 VMs (running PHP applications) in the same VNET. I can connect to the database from both PHP, and from a remote GUI client (SequelPro), so I'm confident the firewall is configured correctly and I'm using the right details.
However, when I try to connect using the mysql CLI client on either of the VMs, it just hangs with no output. I've tried on both VMs, I get the same behaviour.
The command I'm using is:
mysql -u "username#hostname" -p -h "ip_address" -P 3306 database_name -e "SHOW TABLES"
It prompts for the password, so I enter it... and then nothing. On top the mysql process is consuming 100% of CPU.
I can telnet port 3306 on the IP address, I get the usual gibberish asking for mysql_native_password.
If I change the hostname part of the username#hostname to an invalid hostname, then it says "The servername cannot be found". Whereas if I enter an invalid username (or an invalid password) then it hangs just the same. So I'm guessing this has something to do with the gateway part of Azure managed database service that's trying to resolve that name. Everything was working normally up until a few days ago.
There's nothing in any of the logs, and no output on the screen, so I can't work out where to begin trying to fix this.
This appears to be due to https://bugs.mysql.com/bug.php?id=105288 assuming your client is 8.0.27, i hit the same issue today.
What I'm trying to do:
I have a Minecraft server, I'm trying to my an admin panel so the other admins can help out the server more closely.
Right now, I am trying to make a live console. My thought was is that if I have a script fire off every 10 seconds the script would perform a MySQL query and upload the log file contents to the Database and then on the webpage is would display the rows.
What I have tried:
So I looked on StackOverflow and you can query MySQL databases from the Ubuntu terminal and I have tried that.
mysql -u username#Database -pPassword -h azure.database.for.mysql.url -P 3306 -D SchemaName
It does not work as I get an error
ERROR 1045 (28000): Access denied for user 'username'#'machineIp' (using password: YES)
There were people saying to edit the configs and comment out "bind-address" however it seems to only apply to the machine the MySQL server is on, and not the one performing the queries.
Things to note:
The Web Server, Minecraft Servers, and MySQL Server are all on different machines.
The MySQL server is a SaaS provided by Azure.
I use this database for my web server and it works fine in connecting to the server so I believe it is not a MySQL server issue.
I also use this database for my Minecraft permissions plugin and it connects fine.
If you have more questions please ask and I will do my best at answering them.
It looks like its not accepting your password.
This is the format that I use to access mysql from terminal.
mysql --prompt="(\u#\h) [\d]> " --user=your_username --password your_password
I am trying to export database from AWS RDS to my localhost, mysql dump command is like:
`mysqldump -h xxxxx(my RDS account) -u xxx(my username) -p remote_db > dump.sql`,
then my terminal would ask me to enter the password, after entering passsword, it kept showing Got error: 2003: Can't connect to MySQL server, what may cause this problem? I have checked this
Can't get mysqldump to connect to local mysql instance (error 2003 / 10061)
and try to use this solution to fix it, but same thing happens everytime, what can i do?
It is a best practice that your database should be always private so most probably your database would be in private subnet(Not accessible from internet), If RDS is accessible from the internet so check your Security Group, NACL & Route Table configuration.
Feel free to comment if you face same issue the after above checklist.
I found a weird problem that when I connect to my database which locates at another server, the output of show databases; was different with that when I did local.
My database was running MySQL at IP 10.200.0.11, I connect with mysql -u username -p -h 10.200.0.11
I did some search, seems no people reported this problem? Did my mysql client cached something? I tried another client machine, and it works good through.
Any thoughts? Thanks in advance.