Home > dreamhost | mysql | software | unix | web > Installing mysqld on Dreamhost VPS

Installing mysqld on Dreamhost VPS

If you do not already know, PS MySQL is useless! It’s basically a MySQL installation on a VPS where you have control over nothing! The only thing you have is assured memory allocation, which is pretty much useless.

So how? Why not create another VPS and install mysqld on it! Seriously, it’s that simple, with that you get full control of your MySQL server, in a real VPS environment.

Simple steps!

ssh into your VPS

ssh my_vps_admin_username@psXXXXX.dreamhostps.com

where psXXXXX is your VPS server name, like PS23535 etc.

type the following commands to install mysql server and client

sudo apt-get install mysql-server
sudo apt-get install mysql-client
Note
All this point, your installation may fail, with errors like:

Can’t exec “/tmp/mysql-server-5.1.config.181101″: Permission denied at /usr/share/perl/5.10/IPC/Open3.pm line 168.
open2: exec of /tmp/mysql-server-5.1.config.181101 configure failed at /usr/share/perl5/Debconf/ConfModule.pm line 59

when you run:

sudo mount

you will see:

/dev/hdv1 on / type ufs (defaults)
none on /proc type proc (defaults)
none on /tmp type tmpfs (size=128m,mode=1777,nosuid,noexec,nodev)
none on /dev/pts type devpts (gid=5,mode=620)

you need

/dev/hdv1 on / type ufs (defaults)
none on /proc type proc (defaults)
none on /tmp type tmpfs (size=128m,mode=1777)
none on /dev/pts type devpts (gid=5,mode=620)

for your installation to run completely, without error.

Please submit a ticket to DH support, to request for the admin to mount /tmp folder without noexec. However, do note of the potential security issues, you may encounter.

Updates: from dlo in the comment, the default apt-get with DH will install only version 5.0, to get 5.1 while maintaining future update compatibility, simply:

sudo apt-get -t lenny-backports install mysql-server-5.1

Along with the pins in /etc/apt/preferences, this should allow you to keep it updated into the future. lenny-backports is already configured by DH in /etc/apt/sources.list by default.

Add Note
Verified: If you are on a new VPS, it is quite possible that your /etc/apt/preferences and /etc/apt/sources.list are not update or correctly configured for lenny-backports.

In /etc/apt/sources.list you will need to comment out the following line by adding a “#” in the beginning of the line

COMMENT OUT:

#deb http://www.backports.org/debian/ lenny-backports main

then ADD:

deb http://mirror.newdream.net/debian-backports/ lenny-backports main contrib non-free

In /etc/apt/preferences

APPEND:

Package: *
Pin: release a=lenny
Pin-Priority: 500

Package: *
Pin: release a=lenny-backports
Pin-Priority: 200

Package: emacs23
Pin: release a=lenny-backports
Pin-Priority: 900

Package: emacs23-common
Pin: release a=lenny-backports
Pin-Priority: 900

Package: debian-backports-keyring
Pin: release a=lenny-backports
Pin-Priority: 900

if you want to setup for remote access, do the follow:

sudo vi /etc/mysql/my.conf

look for bind-address and change to:

bind-address = psXXXXX.dreamhostps.com

again where psXXXXX is your VPS server name.

mysql -u root -p

then enter your password,

mysql> CREATE DATABASE your_new_database_name;
mysql> CREATE USER ‘newusr’@’psXXXXX.dreamhostps.com’ IDENTIFIED┬áBY ‘your_password';
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘newusr’@’psXXXXX.dreamhostps.com’ WITH GRANT OPTION;
mysql> CREATE USER ‘newusr’@’%’ IDENTIFIED BY ‘your_password';
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘newusr’@’%’ WITH GRANT OPTION;

your mysql database user with username ‘newusr’ can now connect from any remote host, since using wildcard “%”.
just change “%” to a specified hostname if you are having a web application connecting to this database from say dreamhost shared hosting, with “%.dreamhost.com” or “%.dreamhostps.com”

alright! written in a bit of a rush cause i wasted many hours trying to install with much complicated methods! gosh*

Comments:7

Leave a Reply
  1. dlo 11/07/31

    The default settings for apt-get on DH VPS apparently installs mysql 5.0. Do you have a suggested way to install 5.1 that maintains reasonable and stable apt-get settings for the long term?

  2. dlo 11/07/31

    Looks like this is the way to install 5.1:

    apt-get -t lenny-backports install mysql-server-5.1

    Along with the pins in /etc/apt/preferences, this should allow you to keep it updated into the future. lenny-backports is already configured by DH in /etc/apt/sources.list by default.

  3. Steven 11/07/31

    Hi dlo, thanks! i was trying to get 5.1 but a few other methods which supposedly to get 5.1 didn’t work.
    Will update my post on this.

  4. dlo 11/08/03

    Just fyi- the setting changes you proposed for apt are exactly the same as the defaults on my VPS from Dreamhost. I didn’t know they might vary, or else I might have shared them fully.

  5. Steven 11/08/03

    dlo, no worries, yup, those were the same configuration on my ps. But it was different when I created a new ps. Not sure why the difference for a new vps. So just a note :)

  6. Chris Silich 12/01/10

    Does this set everything up to start the mysql service again on reboot?

    Also, can you tell me how to add phpMyAdmin to the mix?

  7. Steven 12/01/10

    Hi Chris, yes, this will set everything to stat up automatically after each VPS reboot.

    To install phpMyAdmin, you will have to do it manually. Just like how you host any other websites, you can download the package from http://www.phpmyadmin.net/home_page/downloads.php.
    There’s a quick guide you can use here too. http://wiki.phpmyadmin.net/pma/Quick_Install

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackbacks:0

Listed below are links to weblogs that reference
Installing mysqld on Dreamhost VPS from How to Get it Working
TOP