|
I'd like to install MySQL into my home directory so that I have full "root access" to my databases; also my application requires a newer version of MySQL than the shared instance already provided for use. I tried following the instructions on this forum post but I get the error:
So, I think the instructions are out-of-date. Is there a newer procedure for installing MySQL on WebFaction? |
|
Yes. For anyone who is interested in building and maintaining their own private MySQL instance, the compilation procedure has changed compared to the old forum post regarding this topic. The new procedure follows. In order to compile and install a private MySQL instance, you should first create a new Custom Application (listening on port) in the Control Panel. This will reserve a port for your new database server, which your applications will connect to. Note: we are not using the Custom Application to serve the MySQL instance; it's merely reserving the port. Therefore, you should not attach the application to a website record. If you require remote access to your database, please open a support ticket to ask us to open your MySQL database port in the firewall. Once the Custom Application (listening on port) has been created, the Control Panel will assign you a port for it. Use that port in the Next, you can compile the MySQL instance into
Next, you will need to create the database. This can be done with something like the following commands, substituting your desired password:
Next, you can test the server by connecting to it:
Finally, you'll need to configure your applications to use the new database server. Specifically, you will need to configure your applications to use the following settings:
Hope that helps!
This answer is marked "community wiki".
Thanks ! Everything worked fine for me with mysql 5.5.14. Very good post ;) But now, how can I update the PHP MySQL Client (5.0.77) ? With a new Apache/PHP stack ??! With this script : https://gist.github.com/924019 for example ? What happens when the server goes down ? How can I configure autostart ?
Yes, if you need a newer version of the PHP MySQL client, then you'll need to build your own PHP stack from source.
You could use Supervisor to monitor your MySQL processes and restart them if they go away. Supervisor could watch your custom Apache instance also. We don't have a step-by-step tutorial for setting that up though. Another approach would be to run a simple cron job every minute that attempts to connect to your MySQL server instance and restart it if it fails. Hello, I have followed your instructions and everything seems to have gone alright except one thing: in order to connect to the database I have to specify the location of the socket file if I write: but if I omit the socket option, I receive this error: so it seems that the default location of the socket file is inside the tmp directory. I could copy the file there, but I fear that it will be deleted while cleaning the tmp directory, so: how can I change the default location of the socket configuration file? I think it is necessary because I do not know if the socket option can be passed by PHP connection string EDIT: I managed to locate the socket in my tmp directory but still get the error message when connecting without indicating the socket location relative to my home directory. It seems that by default it looks in to the main tmp directory relative to the server root and not the local one. 1
You can specify a different socket in PHP by defining mysql.default_socket in a php.ini file in the root of your app directory. This is great. I forgot it was possible on WF to override the php.ini directives. Thank you very much !! Just a curiosity: in case one wants to upgrade in the future his/her custom installation to a next version of mysql (and considering that a backup of existing data is anyway advisable before proceeding) what do you suggest as better: a) upgrade the existing server Thanks Install the new server and than migrate data, its safer.
showing 5 of 7
show all
|