Skip to content

Instantly share code, notes, and snippets.

@thanoojgithub
Last active March 18, 2017 11:05
Show Gist options
  • Select an option

  • Save thanoojgithub/5389aceab5f76769db167da70a53e87c to your computer and use it in GitHub Desktop.

Select an option

Save thanoojgithub/5389aceab5f76769db167da70a53e87c to your computer and use it in GitHub Desktop.
MySQL installation and setup in Ubuntu 16.4
1. To see hostname and fully qualified domain name (FQDN), use:
thanooj@thanooj-VirtualBox:~$ hostname
thanooj-VirtualBox
thanooj@thanooj-VirtualBox:~$ hostname -f
thanooj-VirtualBox
2. Update your system:
thanooj@thanooj-VirtualBox:~$ sudo apt-get update
3. Install MySQL
thanooj@thanooj-VirtualBox:~$ sudo apt-get install mysql-server
4. Root Login
thanooj@thanooj-VirtualBox:~/bigdata$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.17-0ubuntu0.16.04.1 (Ubuntu)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
mysql>
5. create database and grant permissions to user
mysql> create database mydb;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on mydb.* to 'thanooj' identified by 'root';
Query OK, 0 rows affected, 1 warning (0.02 sec)
mysql> exit
Bye
thanooj@thanooj-VirtualBox:~$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment