Gambas - Can’t connect to local MySQL server through socket workaround

Previously I write about Gambas programming and my temporary solution for connecting to MySQL error.

Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

Well, it’s really temporary where the link file that I create previously gone missing whenever I restart my pc. I then need to run the command again and again. Until today I still can’t find the solution.

Here are my workaround for this problem.

It’s just a simple workaround where we just need to create a script and start it at bootup.

Write a simple script and put it in /etc/init.d/ directory.

Add up two line of below command in the script.

sudo mkdir /var/run/mysqld
sudo ln -s /opt/lampp/var/mysql/mysql.sock /var/run/mysqld/mysqld.sock

Once completed, run this command at terminal.

sudo chmod +x MyScriptName
sudo update-rc.d MyScriptName defaults
That's all. Happy programming :)

reference:

Start Script at bootup

If you're new here, you may want to subscribe to my RSS feed or get my latest post directly in your mailbox. Thanks for visiting !

Related Post:
  • How to program Gambas with MySQL in Ubuntu
  • How to Setup Your Web Development Server in 7 Minutes
  • How to run Apache and MySql as a services
  • AutoIT - Connecting to SQL Server.
  • MySQL bought by Sun Microsystems



  • Can't find what you are looking for? Go Gooogle...
    Google

    Leave a Reply


    AWSOM Powered