Problems executing mysql -u -p command

0

I have a problem and a few days ago I tried everything and I could not find the solution.

On my server where my DB is hosted in MySQL when executing MySQL login

mysql -u -p

It shows me the following error

mysql: [ERROR] unknown variable 'general_log=1'

Reviewing the .ini I see that if it declares the variable log_general

general_log_file = /var/log/mysql/mysql.log general_log = 1

postscript: The ini is in /etc/mysql/mysql.conf.d because it uses a !includedir /etc/mysql/mysql.conf.d/ in the my.cnf file

It is more if I delete that line (general_log) and I have placed it in value 0 (in off) I keep appearing that same message, I think it is calling from another party but I do not know where, I do not know if you can give me options where else could I review since I'm worried that I can not run anything around here and can not use Shells.

This comes to me when I put my user, it does not allow me to enter the -p

This comes to me when I put my which mysql

    
asked by Bianco Vidal Saavedra 12.01.2018 в 22:05
source

2 answers

0

After turning the problem a thousand times, I managed to find the solution to the problem.

The error was in the format of the file mysql.cnf (which is to run mysql in console) was in DOS and that's why I did not read it.

What you do is give vi to the mysql.cnf file and convert it to UNIX format with the following commands:

vi ./mysql.cnf
:set ff=unix
:set nobomb
:wq

I did not have the need to restart the MySQL service.

I hope this post will be useful, it took me a while to find the error. Thanks, you vibrate!

    
answered by 08.02.2018 / 17:28
source
0

I notice that you do not enter the user's name. To start a session, you need at least the value for user parameter -u and user password for localhost -p :

 mysql -u NOMBRE_DEL_USUARIO -p

Next, you must enter the password of that user, since as I mentioned, the simple case you are using is in localhost.

By default the user is root and does not have a password:

 mysql -u root -p

Unless you modified this data during installation

    
answered by 12.01.2018 в 22:14