SERVER A
config file:
server-id=1
log-bin="mysql-bin"
binlog-do-db=replicatietest
replicate-do-db=replicatietest
relay-log="mysql-relay-log"
auto-increment-increment = 2
auto-increment-offset = 1
command:
CREATE USER 'replicator'#'%' IDENTIFIED BY 'Slave123';
GRANT REPLICATION SLAVE ON *.* TO 'replicator'#'%' IDENTIFIED BY 'Slave123';
SHOW MASTER STATUS;
--> mysql-bin.000003 397 replicatietest
STOP SLAVE;
CHANGE MASTER TO MASTER_HOST = 'Server A IP Address', MASTER_USER = 'replicator', MASTER_PASSWORD = 'Slave123', MASTER_LOG_FILE = 'mysql-bin.000003', MASTER_LOG_POS = 397;
START SLAVE;
--> OK
Server B
config file:
server-id=2
log-bin="mysql-bin"
binlog-do-db=replicatietest
replicate-do-db=replicatietest
relay-log="mysql-relay-log"
auto-increment-increment = 2
auto-increment-offset = 2
commands
CREATE USER 'replicator'#'%' IDENTIFIED BY 'Slave123';
GRANT REPLICATION SLAVE ON *.* TO 'replicator'#'%' IDENTIFIED BY 'Slave123';
SHOW MASTER STATUS;
--> mysql-bin.000001 154 replicatietest
STOP SLAVE;
CHANGE MASTER TO MASTER_HOST = 'Server B IP Address', MASTER_USER = 'replicator', MASTER_PASSWORD = 'Slave123', MASTER_LOG_FILE = 'mysql-bin.000001', MASTER_LOG_POS = 154;
START SLAVE;
--> OK
I can ping the ip adresses. But when I change something in Server A in the replicatietest, I don't see anything in server B.
Server A and B have both the scheme replicatietest.
Related
MYQSL rep.
I don't know why my MYSQL is not working
DATA CONF:
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
port = 3306
basedir = /usr
lc-messages-dir =/usr/share/mysql
skip-external-locking//
gtid_mode = ON
enforce-gtid_consistency
log-slave-updates
binlog_format = mixed
CHANGE MASTER TOMASTER_HOST='',MASTER_PORT=3306,MASTER_USER='',MASTER_PASSWORD='',
MASTER_AUTO_POSITION=1,GET_MASTER_PUBLIC_KEY=1
I am trying to set up MySQL group replication. Only problem is, that when I try to start replication group, It starts with super_read_only.
Here the configurations in my.cnf file
[mysqld]
max_binlog_size = 4096
default_authentication_plugin = mysql_native_password
log_bin = mysql-bin-1.log
enforce_gtid_consistency = ON
gtid_mode = ON
log_slave_updates = ON
binlog_checksum = NONE
plugin-load-add = group_replication.so
plugin-load-add = mysql_clone.so
relay_log_recovery = ON
transaction_write_set_extraction = XXHASH64
loose_group_replication_start_on_boot = OFF
loose_group_replication_group_name = 74fe8890-679f-4e93-9169-a7edfbc1d427
loose_group_replication_group_seeds = mysql_cluster_mysql0_1:3306, mysql_cluster_mysql1_1:3306, mysql_cluster_mysql2_1:3306
loose_group_replication_single_primary_mode = ON
loose_group_replication_enforce_update_everywhere_checks = OFF
bind-address = 0.0.0.0
instances are run inside docker, that's why group seed addresses has these hostnames.
Also here the procedure for running master instance.
DELIMITER $$
USE `db`$$
DROP PROCEDURE IF EXISTS `set_as_master`$$
CREATE DEFINER=`root`#`%` PROCEDURE `set_as_master`()
BEGIN
SET ##GLOBAL.group_replication_bootstrap_group=1;
CREATE USER IF NOT EXISTS 'repl'#'%';
GRANT REPLICATION SLAVE ON *.* TO repl#'%';
FLUSH PRIVILEGES;
CHANGE MASTER TO MASTER_USER='root' FOR CHANNEL 'group_replication_recovery';
START GROUP_REPLICATION;
-- SELECT * FROM performance_schema.replication_group_members;
END$$
DELIMITER;
After running CALL start_as_master; in Sqlyog, process stucks on below lines.
'CHANGE MASTER TO FOR CHANNEL 'group_replication_recovery' executed'. Previous state master_host='', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''. New state master_host='', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''.
2021-03-03T21:47:55.934818Z 8 [System] [MY-013587] [Repl] Plugin group_replication reported: 'Plugin 'group_replication' is starting.'
2021-03-03T21:47:55.935929Z 9 [System] [MY-011565] [Repl] Plugin group_replication reported: 'Setting super_read_only=ON.'
Why does it run with super_read_only=ON?
Is there anything I miss during configuration or running script?
MySQL version is 8.0.23.
Try to run this then restart the replication
set global super_read_only=0;
Let me know if it works
My xampp phpadmin is is not giving me the option to add users for mysql. I have checked everywhere and cant find the solution. Here is my code in config.inc.php, my.ini and wp-config from
config.inc.php
<?php
/*enter code here
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */
/*
* Servers configuration
*/
$i = 0;
/*
* First server
*/
$i++;
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'pass';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = 'pass';
/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
/*
* End of servers configuration
*/
?>
my.ini
# Example MySQL config file for small systems.
#
# This is for a system with little memory (<= 64M) where MySQL is only used
# from time to time and it's important that the mysqld daemon
# doesn't use much resources.
#
# You can copy this file to
# C:/xampp/mysql/bin/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is C:/xampp/mysql/data) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.
# The following options will be passed to all MySQL clients
[client]
# password = your_password
port = 3306
socket = "C:/xampp/mysql/mysql.sock"
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
skip-grant-tables
port= 3306
socket = "C:/xampp/mysql/mysql.sock"
basedir = "C:/xampp/mysql"
tmpdir = "C:/xampp/tmp"
datadir = "C:/xampp/mysql/data"
pid_file = "mysql.pid"
# enable-named-pipe
key_buffer = 16M
max_allowed_packet = 1M
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log_error = "mysql_error.log"
# Change here for bind listening
# bind-address="127.0.0.1"
# bind-address = ::1 # for ipv6
# Where do all the plugins live
plugin_dir = "C:/xampp/mysql/lib/plugin/"
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
# commented in by lampp security
#skip-networking
#skip-federated
# Replication Master Server (default)
# binary logging is required for replication
# log-bin deactivated by default since XAMPP 1.4.11
#log-bin=mysql-bin
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1
# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
# the syntax is:
#
# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
# MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
# where you replace <host>, <user>, <password> by quoted strings and
# <port> by the master's port number (3306 by default).
#
# Example:
#
# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
# MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
# start replication for the first time (even unsuccessfully, for example
# if you mistyped the password in master-password and the slave fails to
# connect), the slave will create a master.info file, and any later
# change in this file to the variables' values below will be ignored and
# overridden by the content of the master.info file, unless you shutdown
# the slave server, delete master.info and restart the slaver server.
# For that reason, you may want to leave the lines below untouched
# (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id = 2
#
# The replication master for this slave - required
#master-host = <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user = <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password = <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port = <port>
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin
# Point the following paths to different dedicated disks
#tmpdir = "C:/xampp/tmp"
#log-update = /path-to-dedicated-directory/hostname
# Uncomment the following if you are using BDB tables
#bdb_cache_size = 4M
#bdb_max_lock = 10000
# Comment the following if you are using InnoDB tables
#skip-innodb
innodb_data_home_dir = "C:/xampp/mysql/data"
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = "C:/xampp/mysql/data"
#innodb_log_arch_dir = "C:/xampp/mysql/data"
## You can set .._buffer_pool_size up to 50 - 80 %
## of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 16M
## Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
## UTF 8 Settings
#init-connect=\'SET NAMES utf8\'
#collation_server=utf8_unicode_ci
#character_set_server=utf8
#skip-character-set-client-handshake
#character_sets-dir="C:/xampp/mysql/share/charsets"
sql_mode=NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_ENGINE_SUBSTITUTION
log_bin_trust_function_creators = 1
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
wp-config
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
* * MySQL settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* #link https://codex.wordpress.org/Editing_wp-config.php
*
* #package WordPress
*/
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'db_wajcontsruction' );
/** MySQL database username */
define( 'DB_USER', 'root' );
/** MySQL database password */
define( 'DB_PASSWORD', 'pass' );
/** MySQL hostname */
define( 'DB_HOST', 'localhost' );
/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );
/** The Database Collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
/**##+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {#link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* #since 2.6.0
*/
define( 'AUTH_KEY', 'put your unique phrase here' );
define( 'SECURE_AUTH_KEY', 'put your unique phrase here' );
define( 'LOGGED_IN_KEY', 'put your unique phrase here' );
define( 'NONCE_KEY', 'put your unique phrase here' );
define( 'AUTH_SALT', 'put your unique phrase here' );
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
define( 'LOGGED_IN_SALT', 'put your unique phrase here' );
define( 'NONCE_SALT', 'put your unique phrase here' );
/**##-*/
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the Codex.
*
* #link https://codex.wordpress.org/Debugging_in_WordPress
*/
define( 'WP_DEBUG', false );
/* That's all, stop editing! Happy publishing. */
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', dirname( __FILE__ ) . '/' );
}
/** Sets up WordPress vars and included files. */
require_once( ABSPATH . 'wp-settings.php' );
i added a new db but could not create user and even wen i select root user i get an error establishing connection
I intend to create a db for a wordpress website and a user for that database
Try to set this option in config.inc.php:
$cfg['Servers'][$i]['DisableIS'] = true;
It worked for me.
I struggled with a similar issue after upgrading to MySQL 8.0 on Ubuntu 20.04, despite uninstalling MySQL first. The problem was that I didn't delete the mysql schema stored in /var/lib/mysql, and with the upgrade the number of columns in the user table changed. It seems that the installer "as a safety mechanism" alters the privileges in this table, which can be fixed in the mysql command-line console for each individual privilege along the lines of:
UPDATE mysql.user SET Grant_priv = 'Y' WHERE user = 'phpmyadmin' AND host =
'localhost';
I have the same problem, after remove xampp and reinstalled, solve this problem.
I suggest you remove and reinstall xampp program.
Note. If remove xampp program, everything inside htdocs folder
removed.
MySQL was working fine and then for no reason I start getting this error whenever I open http://localhost/phpmyadmin/
I spent hours here trying to find solutions but all what I've tried did not work.
can someone please help me?
I am using: XAMPP Version: 7.3.6
Thanks
config.inc.php file content
<?php
/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */
/*
* Servers configuration
*/
$i = 0;
/*
* First server
*/
$i++;
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';
/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
/*
* End of servers configuration
*/
?>
SOLUTION - TRIED AND TESTED.
open folder >> C:\xampp\mysql\bin
open file (edit) >> my.ini
Add this line
# The MySQL server
default-character-set=utf8mb4
[mysqld]
skip-grant-tables <<<--- Add this line
port=3306
Save file.
Restart XAMPP.
Go to http://localhost/phpmyadmin/
And there you have it.
Run this command
mysqladmin -u root password 'mynewpassword'
$cfg['Servers'][$i]['AllowNoPassword'] = true; <--- change this
$cfg['Servers'][$i]['AllowNoPassword'] = false; <--- to this fixed the problem.
Note: there are other areas in localhost where you have to change the password manually. For example in "CD Collection" example. The password is hard coded there rather than picking it up from config.inc.php.
I do not know why but for some reasons when I start XAMPP control panel as Administrator I can connect to phpMyAdmin with no issues
The error messages are a bit confusing as it mentions MariaDb server. There was a change to WAMP server recently to allow MariaDb, don't know if XAMPP did the same.
WAMP server switch MySQL to MariaDB
Given that it works when you run as Administrator, I'd say it cannot access a settings file when run as normal. Can you check the permissions on config.inc.php?
When it does connect as administrator:
do you have to enter your mySql username and password?
what do you see in the database panel?
Server: Local Databases (127.0.0.1 via TCP/IP)
Server type: MySQL
Server version: 5.7.14 - MySQL Community Server (GPL)
Protocol version: 10
User: root#localhost
Server charset: UTF-8 Unicode (utf8), example:
Possibly a security precaution. You could try adding a new administrator account:
mysql> CREATE USER 'monty'#'localhost' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'#'localhost'
-> WITH GRANT OPTION;
mysql> CREATE USER 'monty'#'%' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'#'%'
-> WITH GRANT OPTION;
https://stackoverflow.com/a/1559992/7528823
I just encountered same problem a few minutes ago, i was sure i didnt need any configuration change so what i did was to clear cookies and site data from 127.0.0.1 (might be localhost instead, in your case) and it was solved!
tryin to install phpMyAdmin on my Fedora server, but if i open it in browser, i get next error:
2002 Cannot log in to the MySQL server
file config.inc.php have next content:
<?php
/* Servers configuration */
$i = 0;
/* Server: localhost [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '123';
/* End of servers configuration */
$cfg['blowfish_secret'] = '4c45c50fe8b283.01675296';
$cfg['DefaultLang'] = 'en-utf-8';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
?>
just to add, in mysql i created user root, with password 123, so i can log in with:
mysql -h localhost -u root -p123
can you help me where is the problem?
mysql -h localhost actually connects via unix socket instead of a TCP connection to 127.0.0.1. Explicitly specifying mysql -h 127.0.0.1 on the other hand does use the TCP method.
So what you are testing is a local socket connection, not a network one. Make sure phpMyAdmin uses the same method; the line
$cfg['Servers'][$i]['connect_type'] = 'tcp';
should probably read
$cfg['Servers'][$i]['connect_type'] = 'socket';
Your mysqld probably has either networking disabled or user permissions denying root/123 access from the network.
With -h localhost in your example you are actually connecting over a named socket. You can see for yourself - from the mysql client type "\s":
mysql> \s
--------------
(....)
Connection: Localhost via UNIX socket
ok, i solve it.
in configuration file, i just changed 'localhost' to '127.0.0.1', and it started to work.
tnx anw!