i've looked up every tutorial on how to fix this and nothing worked so far,
I'm getting this error
No connection could be made because the target machine actively refused it
i'm using linux centos7 mysql version
mysql Ver 14.14 Distrib 5.6.32, for Linux (x86_64) using EditLine wrapper
blow is my.cnf
also i had to create my own my.cnf as when i installed mysql it didn't have one located i put this into etc/my.cnf it's running the cnf as it's taken mysql out of strict mode.
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....
bind-address = 0.0.0.0
#skip-networking
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Ok, I am assuming that you have installed this on a completely different machine (as opposed to a Virtual Host on your Windows box).
You need to make sure that port 3306 is open on your DB server first and foremost. You can check this with a port checker (there are plenty of free ones online).
Then, with the user you are trying to connect with, you need to make sure that user has access from the origin IP address (i.e. the IP on your Windows machine). This can be done with the following code from the mysql prompt.
GRANT ALL PRIVILEGES ON <your db name>.* TO <your user>#<your ip> IDENTIFIED BY '<your password>';
A less secure option would be to allow all inbound IPs by using the % wildcard.
After this you need to run the following command.
FLUSH PRIVILEGES;
That should be it.
Related
On server 1 (lets call it 1.1.1.1 , I have Wordpress installed, which has its own MySQL database.
On server 2 (lets call it 2.2.2.2) , I have only MySQL on Ubuntu, with PhpMyAdmin installed.
I am attempting to connect FROM Wordpress (functions.php) FROM server 1, to server 2's MySQL database through the following:
$mydb = new wpdb('rruser','password','dbname', '2.2.2.2');
Following this connection, everything else is fine.
Upon loading the shortcode through a page, the page does not load the content in the shortcode. I am assuming the connection has timed out.
Please can someone advise how I can go about connecting to an external database?
I have created a new user on "2.2.2.2" and granted priveleges to "dbname".
CREATE USER 'rruser'#'1.1.1.1' IDENTIFIED WITH mysql_native_password AS '***';`
`GRANT USAGE ON *.* TO 'rruser'#'1.1.1.1' REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;`
`GRANT ALL PRIVILEGES ON `rail`.* TO 'rruser'#'1.1.1.1';
My MySQL my.cnf file looks like the following on the remote server which I would like to connect to (2.2.2.2)
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[mysqld]
innodb_file_per_table = 1
Many thanks in advance.
I have resolved my problem by adding bind-address to 2.2.2.2's my.cnf file, as well as allowing mysql's ports in UWF, including TCP and 8080.
Upon rebooting my server the problem is resolved
I do have a Linux instance in Amazon EC2. After installing the Linux instance, I simply installed apache and set up a MySQL database inside it via console. Now I do have questions.
Where is my database is located exactly? I can simply access it via phpMyAdmin like in the same way we do in desktop PCs. Is my database in Amazon EBS ?
How do I know the storage price for the information stored inside my mysql database?
Normally Linux store MySQL information /etc/mysql/my.cnf file, then find datadir path inside the file. You can read the file using cat command.
The result will be like this
$ cat /etc/mysql/my.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
[mysqld]
#
# * Basic Settings
#
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
language = /usr/share/mysql/english
EC2 instance use EBS for storage you can check price storage detail here
I'm working with MySQL Workbench 6.0. I built a schema from a .sql file. It has 1024 tables. when I connect it to local host only 47 tables seem to make it. I check with this command
SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = "my_schema";
Why would it just leave behind the other 977 tables? is it a memory allocation thing? or an issue with my configuration?
Edit 1
result from the MySQL command
SHOW ENGINES;
Edit 2
I checked out the .ini file that my local connection looks at. It uses the default one in
C:\Program Files\MySQL\MySQL Server 5.6
This is its content of my-default.ini
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
so because this is the file its reading and I've not made any changes is there a memory issue for a database that has the large number of tables like mine? Or should I be leaving this allone for my local connection and be changing the settings through MySQL Workbench?
Edit 3
Blow is the results of SQL command
SHOW GRANTS;
First confirm that sql file has all 1024 tables.
Second check that the engine of tables in sql file is present or not in your database server with command SHOW ENGINES:
I am attempting to move a mysql db onto an upgraded server with a newer version of ubuntu running (15.04), and after installing LAMP, I went to edit the bind address in the my.cnf file. The below is all I see in /etc/mysql/my.cnf. I added [mysqld] and the bind address = new address but nothing seems to allow my remote client to connect to this db. It is online and the ip address should be correct. What am i missing? Why is this my.cnf so bare?
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
stupid me, apparently in this version it is the mysqld.cnf under /etc/mysql/mysql.conf.d/. Oh well. Posting this in case anyone else has problems.....
In ubuntu 15.04 the MySQL Server configure file is in:
/etc/mysql/mysql.conf.d/mysqld.cnf
You can find bind-address here.Comment it, and restart your MySQL Server use :
service mysql restart
Then you can access your MysqlServer from other computer. If you don't, perhaps you need grant some right to the user you use.
You can see MySQL Server bind-address use:
netstat -tap | grep mysql
So you know whether the configure take effect.
Depending on your linux distro your my.cnf (as well as the rest of your data directory) may be in /var/lib/mysql folder.
You could also run the find command to look for the file: find -name 'my.cnf'.
I suggest running this command as root, in your root directory.
Once you have located the correct my.cnf file there will be a parameter under [mysqld] section that looks like this:
bind-address = 127.0.0.1
Comment this parameter out with a # and save the edited my.cnf file. Restart the Mysql server and you should be able to connect remotely from any IP as long as the user you are trying to connect with as the correct permissions and host(%).
You can check this by running:
select user, host from mysql,user;
and show grants for 'youruser'#'yourhost';
grants and privileges for Mysql.
I have downloaded MYSQL via:
bash <(curl -Ls http://git.io/eUx7rg)
Prior to installing I've completely uninstalled previous components via:
http://community.jaspersoft.com/wiki/uninstall-mysql-mac-os-x
I've had to modify permissions in order to see the log file and see primarily permissions errors. Also, when I try:
type mysql
The result, in terminal, points to a directory that does not exist on my local system. When I trace the path to the executable (via Finder) I get the following error in Terminal:
/usr/local/mysql-5.6.19-osx10.7-x86_64/bin/mysql ; exit;
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)
logout
Also, when I look at my.conf file, everything is asterisked out:
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
Had the same problem. Had to switch machines for a week and installing MySQL on "OS X 10.9.3 (13D65)" would not work. Had to wipe the account clean and reinitialize the user to get it going. Apparently there was still an old mysql which wasn't uninstalled completely. Google "uninstall mysql manually"
The access denied happens sometime when the grant is given to the interface 127.0.0.1 but not to localhost.
Try granting access to %, 127.0.0.1, and localhost.