Monday, February 18, 2019

[google-cloud-sql-discuss] Re: running mysqlcheck: can't connect

Based on the MySQL error you are getting, I believe one of the most common issues that may cause this error is that the system or init script is passing a different path for the socket than the one defined in your my.cnf. Thus, it returns a result of a failure when MySQL attempts to start or restart.


A possible workaround for your local, would be to check the my.cnf and all associated configuration files and evaluate what is being defined for the socket. If the MySQL configuration is defining something other than what the startup script is asking for then you can change it to the following: socket= /var/run/mysqld/mysqld.sock. Then click save edit and restart the MySQL again. Hope this resolves the MySQL issue you are encountering.


In regards to the import of your "mysql dump that isn't accepted", they're a few special instructions when creating this file. For instance, you will have to "exclude all triggers, stored procedures, views, and functions from the export. This is needed to enable Cloud SQL to import the dump file"[1].  Also, when attempting to import a SQL dump file, it is important to note that the database you are importing into must already exist on your Cloud SQL instance[2]. The following documentation[3] highlights the steps to import your SQL dump file. Google offers multiple methods to import your database. However, the link I have provided highlights the instructions for gcloud.




On Saturday, January 26, 2019 at 9:44:24 AM UTC-5, Chris Haynes wrote:
I have created a cloud SQL instance, and am trying to migrate data to it from a mysql dump that isn't accepted. To narrow the problem I've tried removing most of the .sql file contents, but it won't load and doesn't even have the Application/x-sql bucket type. So my next step was to run the mysqlcheck. 

The find command you recommend yields 11 files with .sock extension and the ps command shows one mysqld process. No idea which one to put in the my.conf file, which I can't find as it's not in /etc. And there's no /var/run/mysqld directory. 

I do see a mysqld from the Cloud shell, but if sql dump integrity checking isn't something that's reasonable to do in that environment, that would be good to know. I'd like to avoiding setting up mysql on another server for testing if the cloud shell will do, but could if necessary.

If this sort of problem is more appropriate for stackoverflow I don't mind taking it there. On the other hand, there's no programming involved in what I'm trying to do here. Coding is all on the php side, which I can't test until I have the db imported.

Thanks for your reply.

On Thursday, January 24, 2019 at 1:29:31 PM UTC-5, George (Cloud Platform Support) wrote:
Hello Chris, 

In which way is this question related to Cloud SQL, which is a fully managed MySQL Community Edition databases in the cloud? You seem to refer to a local MySQL instance. Do you have a MySQL instance running in Compute Engine? 

You may first try to find all socket files on your system with the "sudo find / -type s" command, and once path to the socket file is known, you may edit /etc/my.cnf file with the path, something similar to socket=/var/lib/mysql/mysql.sock. As a next step, you may try to stop the mysqld process with service mysqld stop, or other commands with the same effect, then delete the pid file in /var/run/mysqld/ . You should also run ps -aux | grep mysqld to see if other MySQL processes are running. 

This discussion group is oriented more towards general opinions, trends, and issues of general nature touching App Engine and Cloud SQL. For coding and programming architecture, as well as setting up MySQL instances, you may be better served in dedicated forums such as stackoverflow, where experienced programmers are within reach and ready to help. 

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/319e283e-2349-4cea-a701-bd63fb1b23af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment