Skip to content

Instantly share code, notes, and snippets.

@debojyoti
Created March 21, 2020 19:06
Show Gist options
  • Save debojyoti/8d05f51744bfb0598bead1ed3dfa008e to your computer and use it in GitHub Desktop.
Save debojyoti/8d05f51744bfb0598bead1ed3dfa008e to your computer and use it in GitHub Desktop.

Get started with node, mysql and phpmyadmin in ubuntu

1) Install node and npm

sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm

2) Install mysql, apache2 and mysql-server

sudo apt-get install apache2 mysql-server -y

3) Install and configure mhpmyadmin

sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install phpmyadmin php-mbstring php-gettext -y

During the installation process, select Apache over lighttpd and select all positive options

Once installation is done run

sudo phpenmod mbstring
sudo systemctl restart apache2

4) Configure User Authentication

sudo mysql

You can configure the root account to authenticate with a password by running the following command:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
mysql> FLUSH PRIVILEGES;

Next, create a separate user with name phpmyadminuser to connect to phpMyAdmin. First, log in to MySQL shell:

mysql -u root -p

Then

CREATE USER 'phpmyadminuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadminuser'@'localhost' WITH GRANT OPTION;
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment