Introduction
phpMyAdmin is a very famous MySQL mangement software package. To use it you should install and configure PHP, Apache and php mysql (or mysqli) extension see ApacheMySQLPHP for instructions.
Installing From Package
Install phpMyAdmin from the Universe repository see InstallingSoftware for detailed instructions on using repositories and package managers. (Note, however, that installation from a package manager often does not work).
From console:
sudo apt-get install phpmyadmin
sudo apt-get update sudo apt-get install phpmyadmin
For the server selection, choose apache2.
Select yes when asked whether to use dbconfig-common to set up the database
You will be prompted for your database administrator's password
You will then be asked to choose and confirm a password for the phpMyAdmin application itself
The installation process actually adds the phpMyAdmin Apache configuration file into the /etc/apache2/conf-enabled/ directory, where it is automatically read.
The only thing we need to do is explicitly enable the php5-mcrypt extension, which we can do by typing:
sudo php5enmod mcrypt
Afterwards, you'll need to restart Apache for your changes to be recognized:
sudo service apache2 restart
You can now access the web interface by visiting your server's domain name or public IP address followed by /phpmyadmin:
http://domain_name_or_IP/phpmyadmin
Should you get a 404 "Not Found" error when you point your browser to the location of phpMyAdmin (such as: http://localhost/phpmyadmin) this is likely caused by not checking the 'Apache 2' selection during installation. To redo the installation run the following:
sudo dpkg-reconfigure -plow phpmyadminok click on kohadb
Then select Apache 2 for the webserver you wish to configure.
If this does not work, then you can do the following to include the phpMyadmin-shipped Apache configuration into Apache:
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf
sudo /etc/init.d/apache2 reload
manually include the phpMyAdmin-shipped Apache configuration file in Ubuntu 14.4, you must run the following:
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf sudo /etc/init.d/apache2 reload
In case of mbstring extension is missing in Ubuntu 16.04. Please check your PHP configuration and try following command
sudo apt-get install php-mbstring php7.0-mbstring php-gettext sudo service apache2 restart
Installing from source
You may install phpmyadmin from source. This method circumvents the package manager and you will need to install updates yourself. This is not recommended for a production web server. Also, you'll need to have Subversion installed to download the source.
To install it from source open the console and cd to the www directory using:
cd /var/www/
then download it using svn by writing:
sudo svn checkout https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/tags/STABLE/phpMyAdmin phpMyAdmin
then cd to phpMyAdmin
cd phpMyAdmin
and create the folder config
sudo mkdir config
after that chmod it
sudo chmod o+rw config
then open http://localhost/phpmyadmin/scripts/setup.php and follow the instructions.
Note: This guide has been tested on Ubuntu 6.06 (Dapper), Ubuntu 7.10 (Gutsy), and Ubuntu 8.04 (Hardy).
CategorySoftware
phpMyAdmin (last edited 2010-04-18 22:19:30 by jeremie.miserez)
* Page History
The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details
Recover MySQL root Password
You can recover MySQL database server password with following five easy steps.
Step # 1: Stop the MySQL server process.
Step # 2: Start the MySQL (mysqld) server/daemon process with the --skip-grant-tables option so that it will not prompt for password.
Step # 3: Connect to mysql server as the root user.
Step # 4: Setup new mysql root account password.
Step # 5: Exit and restart the MySQL server.
Here are commands you need to type for each step (login as the root user):
Step # 1 : Stop mysql service
# /etc/init.d/mysql stop
Output:
Stopping MySQL database server: mysqld.
Step # 2: Start to MySQL server w/o password:
# mysqld_safe --skip-grant-tables &
Output:
[1] 5988
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[6025]: started
Step # 3: Connect to mysql server using mysql client:
# mysql -u root
Output:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
Step # 4: Setup new MySQL root user password
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
Step # 5: Stop MySQL Server:
# /etc/init.d/mysql stop
Output:
Stopping MySQL database server: mysqld
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[6186]: ended
[1]+ Done mysqld_safe --skip-grant-tables
Step # 6: Start MySQL server and test it
# /etc/init.d/mysql start
# mysql -u root -p
MySQL Change User Password
How do I change user password under MySQL server? I'd like to change a password for user called tom using UNIX / Linux command line option.
First, login to MySQL server, type following command at shell prompt to login as root
$ mysql -u root -p
2) Use mysql database (type command at mysql> prompt, do not include string "mysql>"):
mysql> use mysql;
3) Change password for user tom:
mysql> update user set password=PASSWORD("NEW-PASSWORD-HERE") where User='tom';
mysqladmin -ukohaadmin -p -h 'localhost' password "praveen123"
Mysql dump (Koha Backup)
mysqldump -u kohaadmin -p koha > mydatadump.sql
Koha backup restore
mysql -u kohaadmin -p koha < mydatadump.sql
Phpmyadmin login error
Use the following steps to reset a MySQL root password by using the command line interface.
(Ubuntu operating system and Debian) Run the following command:
sudo /etc/init.d/mysql stop
(CentOS, Fedora, and Red Hat Enterprise Linux) Run the following command:
sudo /etc/init.d/mysqld stop
Run the following command. The ampersand (&) at the end of the command is required.
sudo mysqld_safe --skip-grant-tables &
Run the following command:
mysql -uroot
Run the following command:
use mysql;
update user set authentication_string=PASSWORD("mynewpassword") where User='root';
flush privileges;
quit
(Ubuntu operating system and Debian) Run the following commands:
sudo /etc/init.d/mysql stop
...
sudo /etc/init.d/mysql start
(CentOS, Fedora, and Red Hat Enterprise Linux) Run the following commands:
sudo /etc/init.d/mysqld stop
...
sudo /etc/init.d/mysqld start
Test the new password by logging in to the database.
mysql -u root -p
Enter your new password when prompted.
new user
CREATE USER 'sammy'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'sammy'@'localhost' WITH GRANT OPTION;
exit
For Fast import database in mysql: This is how to set RolandoMySQLDBA configuration in linux:
Open mysql conf file in your favourite text editor:
sudo vi /etc/mysql/my.conf
Type the following configuration at the end of the file:
[mysqld]
innodb_buffer_pool_size = 4G
innodb_log_buffer_size = 256M
innodb_log_file_size = 1G
innodb_write_io_threads = 16
innodb_flush_log_at_trx_commit = 0
innodb_doublewrite = 0
Save the file and run this command in mysql:
set global innodb_fast_shutdown = 0
you can see the new configuration with @@ followed by command in mysql:
select @@innodb_buffer_pool_size;
similarly with other commands
Restart mysql:
service mysql restart
Restore your database state:
mysql -u username -p database_name < /path/to/file.sql
Finding Your PHP Version:
Open a terminal window and type this:
php -v
This will display your PHP version.
Installing the Missing Tool:
Based on your PHP version, type this command in the terminal and press Enter:
sudo apt install libapache2-mod-php8.1
Important Note: Replace 8.1 with your actual PHP version if it’s different. This command utilizes sudo for boss mode and apt to install the missing tool (libapache2-mod-php8.1).
Restarting Apache:
After installation, type this command to restart Apache and make the changes take effect:
sudo systemctl restart apache2