I believe from my point you haven't run mysql_secure_installation which help to enables and set password base auth for user root.
As you already mention that you follow that link where they haven't set the password for the root user they only create a standard user for their database.
Now how you can solve it all you need to do is run the below commands in order.
First, open the terminal by Ctrl+Alt+T or just search for the terminal.
Take the sudo access by running the below command:
sudo suIt will give you root access to your laptop. you can also avoid taking the root access but for that, you need to run every command using sudo at beginning of every command.
Run the security script with sudo:
sudo mysql_secure_installationThis will take you through a series of prompts where you can make some changes to your MySQL installation’s security options.
Select Y for every option you don't have to worry about anything it's just a just basic configuration of MySQL
once you are done with that now take access to your Mysql server:
sudo mysql -u root -pThe password is which you have set up while running the command of sudo mysql_secure_installation
once you got into the terminal use create a user with all privileges.
for the run the below command:
CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost';Warning: Don't run this command on the production server as such broad privileges should not be granted lightly, as anyone with access to this MySQL user will have complete control over every database on the server.
Following this, it’s good practice to run the FLUSH PRIVILEGES command. This will free up any memory that the server cached as a result of the preceding CREATE USER and GRANT statements:
FLUSH PRIVILEGES;Then you can exit the MySQL client:
exitIn the future, to log in as your new MySQL user, you’d use a command like the following:
mysql -u user-pThe -p flag will cause the MySQL client to prompt you for your MySQL user’s password in order to authenticate.
by coming this far your problem will solve.
phpmyadmin-cli - bringing phpMyAdmin to the command-line. MySQL databases are often managed using the popular administration tool phpMyAdmin. Unfortunately, automation and scripting of the commands available in the web-based interface of phpMyAdmin can be cumbersome.phpMyAdmin command-line interface
phpmyadmin-cli provides a command-line interface for phpMyAdmin, providing easy command-line access to your MySQL database. Commands given on stdin are handed to phpMyAdmin to be executed on the MySQL database. The results of these commands are then printed to stdout. An interactive shell is also available.
phpmyadmin-cli is written in Python.
Requirements
- Python 2.6+
- Requests
- PTable
- phpMyAdmin 3.x or 4.x
Installation
On most UNIX-like systems, you can install phpmyadmin-cli by running one of the following install commands as root or by using sudo.
git clone git://github.com/fdev/phpmyadmin-cli.git cd phpmyadmin-cli python setup.py install
or
pip install git+//github.com/fdev/phpmyadmin-cli
Usage
Usage: phpmyadmin-cli [OPTIONS] database -e, --execute=name Execute command and quit. -E, --export=table Export specified tables, can be used multiple times. -A, --export-all Export all tables. -h, --help Display this help and exit. -l, --location=url Location of phpMyAdmin (//localhost/phpmyadmin/). -p Prompt for password to use. --password=name Password to use. -s, --ssl-ignore Ignore bad SSL certificates. -t, --timeout=n Http request timeout in seconds. -u, --user=name User for login if not current user. -V, --version Output version information and exit.
Examples
Import a sql file
$ phpmyadmin-cli testdatabase < database.sql
Export an entire database
$ phpmyadmin-cli --export-all testdatabase > database.sql
Export specific tables
$ phpmyadmin-cli --export article testdatabase > articles.sql
Execute a single query
$ phpmyadmin-cli -e 'SELECT di FROM article' testdatabase ERROR #1054 - Unknown column 'di' in 'field list' $ phpmyadmin-cli -e 'SELECT id FROM article' testdatabase "id" "1" "2" "3" "4" "5"
Using the interactive shell
$ phpmyadmin-cli testdatabase Welcome to the phpMyAdmin command-line interface. Copyright (c) 2014, fdev.nl. All rights reserved. This application is not affiliated with or endorsed by the phpMyAdmin Project or its trademark owners. phpmyadmin> SHOW TABLES; +------------------------+ | Tables_in_testdatabase | +------------------------+ | article | | comment | | user | | access_log | +------------------------+ Query OK, 4 rows (0.05 sec) phpmyadmin> DESCRIBE article; +------------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | title | varchar(255) | NO | | NULL | | | content | text | NO | | NULL | | | created | datetime | NO | MUL | NULL | | | created_by | int(11) | NO | MUL | 0 | | +------------------+--------------+------+-----+---------+----------------+ Query OK, 5 rows (0.06 sec) phpmyadmin> SELECT id, title FROM article ORDER BY title; +----+----------------+ | id | title | +----+----------------+ | 5 | Fifth article | | 1 | First article | | 4 | Fourth article | | 2 | Second article | | 3 | Third article | +----+----------------+ Query OK, 5 rows (0.03 sec)
Known limitations
- No easy way to switch between different databases.
- Will probably break when using a non-default phpMyAdmin theme.
- When using stdin there will be no output (you can use --execute).
Compatibility
While phpmyadmin-cli should work with phpMyAdmin 3.x and 4.x, it has only been tested with on 3.3.10deb1, 3.4.4, 3.5.8.1deb1 and 4.1.11.
Frequently Asked Questions
Q: Does phpmyadmin-cli work over https?
A: Yes it does. You can ignore bad certificates using the --ssl-ignore option.
Q: Was this an April Fools joke?
A: Yes, you should obviously use the mysql command when available. However, the application does fully work as described and, unfortunately, actual use cases for this application do exist.
This application is not affiliated with or endorsed by the phpMyAdmin Project or its trademark owners.