Mysql: Can´t start Server debian wheezy - mysql

Everytime i try to start my mysql service i get the same error
Error message:
150130 15:56:31 [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address
150130 15:56:31 [ERROR] Do you already have another mysqld server running on port: 3305 ?
150130 15:56:31 [ERROR] Aborting
My Error log is empty
Conf file snippet:
[client]
port = 3305
socket = /var/run/mysqld/mysqld.sock
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3305
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
Sorry for my bad english
Complete Conf file

Looks like your port(3305) is occupied by another process.. you can :
1) switch to different port
2) kill/modify the process holding this port
(look it up using:
lsof -i :3305
)
in addition, this could be the cause of it (as one stated in this post) :
Change bind-address to 127.0.0.1 instead of localhost

Skipping network worked for me :
# echo "skip-networking" >> /etc/mysql/my.cnf
Then start mysql again.

Related

MySQL only starts in safe-mode

It appears that MySQL instance only starts when I issue the skip-grant-tables and when I go to start it the normal way, service mysql start I am getting the cannot connect to socket.
I have seen plenty of solutions but nothing has worked.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock nice = 0
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
bind-address = 127.0.0.1
key_buffer = 16M
max_allowed_packet = 16M
/var/run/mysqld# ls -atlr
total 0
drwxr-xr-x 22 root root 720 Oct 14 01:05 ..
drwxr-xr-x 2 mysql mysql 40 Oct 14 02:33 .
Steps to overcome
Go to Edit->Preferences menu under MySQL Workbench.
uncheck "Safe Update".
Restart WorkBench.
attached is the screenshot Screenshot from MySQL Workbench.

Running two instances of mysql

I'm trying to run two instances of MySQL on the same machine and setup my.cnf file as the following:
[mysqld1]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3307
datadir = /var/lib/mysql
[mysqld2]
user = mysql
pid-file = /var/run/mysqld/mysqld2.pid
socket = /var/run/mysqld/mysqld2.sock
port = 3308
datadir = /var/lib/mysql2
When I execute mysqld_multi start command, it arises the following error:
Installing new database in /var/lib/mysql2
2016-10-06 17:47:23 [WARNING] mysql_install_db is deprecated. Please
consider switching to mysqld --initialize 2016-10-06 17:47:23 [ERROR]
Can't locate the server executable (mysqld).
FATAL ERROR: Tried to start mysqld under group [mysqld2], but no data
directory was found or could be created. data directory used:
/var/lib/mysql2
How can I solve this?
Note: MySQL is running on Ubuntu 16.0.4 and MySQL 5.7
I know the one question.
2016-10-06 17:47:23 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize 2016-10-06 17:47:23 [ERROR] Can't locate the server executable (mysqld).
Please vim the line 343 to 344&345 in the file /use/bin/mysqld_multi
343 #$install_cmd="/usr/bin/mysql_install_db ";
344 $install_cmd="/usr/bin/mysqld ";
345 $install_cmd.="--initialize ";
346 $install_cmd.="--user=mysql ";
347 $install_cmd.="--datadir=$datadir";

Why mysqld_multi can't start mysql?

In my my.cnf, I write:
[mysqld_multi]
mysqld = /usr/local/Cellar/mysql/5.7.11/bin/mysqld_safe
mysqladmin = /usr/local/Cellar/mysql/5.7.11/bin/mysqladmin
user = root
password =
[mysqld1]
pid-file = /usr/local/etc/mysql/mysqld.pid
socket = /usr/local/etc/mysql/mysqld.sock
port = 3306
datadir = /usr/local/var/mysql
log-bin=mysql-bin
server-id=1
[mysqld2]
pid-file = /usr/local/etc/mysql/mysqld1.pid
socket = /usr/local/etc/mysql/mysqld1.sock
port = 3307
datadir = /usr/local/var/mysql1
server-id=2
language=/usr/local/Cellar/mysql/5.7.11/share/mysql/english
user=mysql
Then I execute mysqld_multi start 2, and I get the error info:
Installing new database in /usr/local/var/mysql1
2016-09-19 19:37:16 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2016-09-19 19:37:16 [ERROR] Can't locate the language directory.
FATAL ERROR: Tried to start mysqld under group [mysqld2],
but no data directory was found or could be created.
data directory used: /usr/local/var/mysql1
I can't start the mysql process, so what's the problem? It seems the directory /usr/local/var/mysql1 has some problems, but the directory exists, it's confused.
It seems like mysqld_multi wasn't fixed to use mysqld --initialize.
You will have to run mysqld --initialize along with all directory related options in my.cnf for that server.
(from comment)
You can also fix the mysqld_multi script following the instructions in Running two instances of mysql.

start : job failed to start (MySQL)

I went through various forum to increase the speed of the MySQL import and found that i have to increase the buffer size. So I added the following two lines in my.cnf file under [mysqld] section
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
innodb_buffer_pool_size=4G
innodb_log_file_size=1G
After adding these two lines if I restart the mysql server it displays
start: Job failed to start
If i am wrong where should i add these lines?

ERROR 2002 (HY000) on installing moodle on ubuntu 14.04

I follow the steps in:
http://docs.moodle.org/27/en/Step-by-step_Install_Guide_for_Ubuntu
and in step 6, after typing the following command :
mysql -u root -p
I have this error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
And when I go to the '/var/run/mysqld I can't found mysqld.sock although in file(/etc/mysql/my.cnf)the :
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
So why this error?
I would recommend following the installation instruction for Apache/MySql/PHP at :
https://help.ubuntu.com/community/ApacheMySQLPHP
Basically
sudo apt-get install lamp-server^
Then follow the instructions for installing Moodle
http://docs.moodle.org/27/en/Installing_Moodle