Question

No database connection...

Hello,

Here I am trying to launch my first website through a digital ocean vps.

I have configured LAMP according to digital ocean guides, but the website does not make the connection to the database.

I have tested the website in local and it works perfectly, I am guessing this issue has something to do with apache or mysql setup?

Below are the commands entered so far… What am I missing or doing wrong?? (Im using Ubuntu 14.04)

Any advice is welcomed, thank’s in advanced :)

      •   sudo apt-get update
        
      •   sudo apt-get install apache2
        

      •      sudo apt-get install php5 libapache2-mod-php5 php5-   
        
      •   mcrypt
        
      •   sudo service apache2 restart
        

      • 	sudo apt-get update
        
      •       sudo apt-get install mysql-server
        
      •       sudo mysql_install_db
        
      •       sudo mysql_secure_installation
        
      •       sudo nano /etc/mysql/my.cnf 
        
      •   bind-address = your_database_IP
        
      •       sudo service mysql restart
        

      •      PhpMyAdmin: sudo apt-get install phpmyadmin apache2-utils
        
      •   sudo nano /etc/apache2/apache2.conf
        
      •   Include /etc/phpmyadmin/apache.conf
        
      •   sudo service apache2 restart
        
Subscribe
Share

what CMS are you trying to use? Can you login to mysql via the command line with the username/password in your config file?

mysql -u yourUser -p

then press enter and type in your password


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey there,

For the most part, you would want bind-address = to either be the default 127.0.0.1 or 0.0.0.0. By only listening on the public address, the web software database connections that look for localhost or 127.0.0.1 would not be able to connect.

Happy coding,

Jon Schwenn Platform Support Specialist DigitalOcean