how to access mysql from command line -- Linux

Problems with the Linux version of XAMPP, questions, comments, and anything related.

how to access mysql from command line -- Linux

Postby steveo_88 » 07. October 2015 14:39

Having significant trouble interacting with mysql from the linux terminal. I navigate to /opt/lampp/bin and type in

Code: Select all
mysql -uroot -p


I get this output:
The program 'mysql' can be found in the following packages:
* mysql-client-core-5.1
* mysql-cluster-client-5.1
Try: sudo apt-get install <selected package>


Meanwhile, no problem querying my db through phpMyAdmin.

Any ideas what's going on? after extensive internet searches, I'm still stumped.
steveo_88
 
Posts: 2
Joined: 07. October 2015 14:13
Operating System: Linux ubuntu 11.10

Re: how to access mysql from command line -- Linux

Postby Nobbie » 07. October 2015 17:35

steveo_88 wrote:Any ideas what's going on? after extensive internet searches, I'm still stumped.


Yes, that is very very very basic linux knowledge: the current directory is NOT part of the PATH environment variable. You have to prepend the current directory to the command call:

Code: Select all
./mysql -u root -p
Nobbie
 
Posts: 13175
Joined: 09. March 2008 13:04

Re: how to access mysql from command line -- Linux

Postby steveo_88 » 07. October 2015 17:43

ahhh... yes that was it. Much appreciated, problem solved. Completely forgot that I start xampp every morning in exactly that way: /opt/lampp/lampp start, for some reason I thought starting mysql would be different. thanks!
steveo_88
 
Posts: 2
Joined: 07. October 2015 14:13
Operating System: Linux ubuntu 11.10

Re: how to access mysql from command line -- Linux

Postby jayrrilles » 27. April 2016 01:18

I was able to use the command but after, instead of seeing mysql on the prompt it shows "MariaDB [(none)]".

What does this mean?
jayrrilles
 
Posts: 1
Joined: 27. April 2016 01:07
XAMPP version: 7.0.5
Operating System: Ubuntu 16.04

Re: how to access mysql from command line -- Linux

Postby Nobbie » 28. April 2016 10:29

jayrrilles wrote:I was able to use the command but after, instead of seeing mysql on the prompt it shows "MariaDB [(none)]".

What does this mean?


It means what it says - you have a MariaDB installation. Google for MariaDB and you will find proper information about MariaDB. What it is and what it does. If you had looked for the Xampp description you would have seen, that Xampp does not deliver MySQL anymore, but MariaDB instead: from https://www.apachefriends.org/index.html

What is XAMPP?

XAMPP is the most popular PHP development environment

XAMPP is a completely free, easy to install Apache distribution containing MariaDB, PHP, and Perl. The XAMPP open source package has been set up to be incredibly easy to install and to use.
Nobbie
 
Posts: 13175
Joined: 09. March 2008 13:04


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 135 guests