When attempting to connect to remote MySQL server from my Windows machine using MySQL workbench - I get an error about connecting to localhost (unsure where the software is picking up localhost). However when I attempt to connect through an SSH tunnel it connects just fine (I cannot use this for the software I am creating though)
when I run netstat on the server:
netstat command
...(more entries)
the bind address has been altered in mariadb and mysql configs. if there are any more configs people would like to see to help with solution please let me know. I have also set up the user in mysql to allow remote privileges:
mysql users
I am pretty confused.
I have installed mysql using dmg from mysql website.
mysql-8.0.23-macos10.15-x86_64.pkg
package version: mysql-8.0.23-macos10.15-x86_64.dmg
I have connected to localhost server using: mysql connect -h127.0.0.1 -uroot
I am successfully connected and able to run operation/queries.
But not able to connect through django project. I suspect it is due to server not running. I am unable to understand when server is not running how i am able to connect from terminal.
UPDATE:
After reading answer on dba exchange I realised it might be because I
ran kill to stop mysql server.
I run two servers one being a web hosting and one being a VPS. I want to use my MySQL server on my web hosting and done everything possible but it still will not work. I started by running the mysql command to grant privileges and it showed that the command went through fine although I still got a refused connection on my web server. I then got told to comment out bind_address in the config but once again it failed.
How can I go about fixing this?
Thanks.
You have to allow mysql to accept requests from remote not only localhost.
To do that you should edit /etc/mysql/mysql.conf.d/mysqld.cnf and change from:
bind-address = 127.0.0.1
to:
bind-address = 0.0.0.0
and restart the mysql server with this command: systemctl restart mysql.service
This errors block me, I can remote read data but I can't update,add mysql data...
Config:
PHPMYADMIN
php 7.0
Mysql5.7
Ubuntu zesty
Nginx
HELP!
The username with which PhpMyAdmin accesses the db is not properly configured. Have a look in config.inc.php and update it there.
I'm using Ubuntu 12.04 LTS.
There is on MySQL server situated remotely. I want to restart it.
Can someone please give me in detail step-by-step instructions to restart the MySQL server?
Following are the Database server details of MYSQL I got from phpMyAdmin UI:
Server: Localhost via UNIX socket
Server type: MySQL
Server version: 5.5.40-0ubuntu0.14.04.1 - (Ubuntu)
Protocol version: 10
User: root#localhost
Server charset: UTF-8 Unicode (utf8)
Can someone please help me?
SSH into the machine. Using the proper credentials and ip address, ssh root#128.0.0.1. This should provide you with shell access to the Ubuntu server.
Restart the mySQL service. sudo service mysql restart should do the job.
If your mySQL service is named something else like mysqld you may have to change the command accordingly or try this: sudo /etc/init.d/mysql restart
sudo service mysql stop;
sudo service mysql start;
If the above process will not work let's check one the given code above you can stop Mysql server and again start server
Another way is:
systemctl restart mysql
To restart mysql use this command
sudo service mysql restart
Or
sudo restart mysql
Reference
I SSH'ed into my AWS Lightsail wordpress instance, the following worked:
sudo /opt/bitnami/ctlscript.sh restart mysql
I learnt this here:
https://docs.bitnami.com/aws/infrastructure/mysql/administration/control-services/
I have had a problem with my WordPress site, the connection with MySql has gone away, and to get it back I had to restart the server. This has been an annoying issue as I do not have that high traffic on the site.
I tried to check if MySQL is up and make the cronjob restart it but that does not work that well. I have been looking at the log, using.
tail /var/log/mysql/error.log
In the log, I looked for shutdown messages or errors. I identified that the MySQL connection crashed when the server run out of memory, so why did it run out of memory. I started to optimize Mysql resources by using the optimization tool from Percona tools.
I also checked when my WordPress is running smoothly or what is causing heavy traffic peaks to your DB. One way is to increase the size of the server, I did not have that much traffic, so I installed the New Relic tool on my server to monitor the server resources to find out which processes are consuming memory.
I found out that the server did not have enough memory and MySQL can’t allocate what it needs so it crashes, what I did was add swap space to help this.
here is the method to Add Swap Space
https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04
If that's not enough, you may need to consider upgrading to a larger server. Either way, you should take a closer look at your memory consumption to better understand the problem.
You can simply run from your local terminal
ssh username#www.remoteserver.com -- sudo service mysqld restart
What worked for me on an Amazon EC2 server was:
sudo service mysqld restart