Failed to clone an exist mysql server using mysqlserverclone utilities - mysql

I installed mysql server 5.7.12 utilities 1.5.6 using mysql installer for windows. I configed mysql-server through installer wizard. Then, I try to clone this server using mysqlcloneserver utilities:
mysqlserverclone --server=root:mysql#localhost:3306 --new-data="C:/Users/quyet/Documents/DBMS/fabric/store" --mysqld="--server-id=2 --log-bin --log-slave-updates --gtid-mode=ON --enforce-gtid-consistency" --new-port=13000 --delete-data
The command ouput this error after run the command:
WARNING: Using a password on the command line interface can be insecure.
# WARNING: Root password for new instance has not been set.
# Cloning the MySQL server running on localhost.
The console has detected that the utility 'mysqlserverclone' ended with an error code.
You can get more information about the error by running the console command 'show last error'.
I run command:
show last error
and get this output:
Execution of utility: 'mysqlserverclone --server=root:mysql#localhost:3306 --new-data=C:/Users/quyet/Documents/DBMS/fabric/store --mysqld=--server-id=2 --log-bin --log-slave-updates --gtid-mode=ON --enforce-gtid-consistency --new-port=13000 --delete-data' ended with return code '1' and with the following error message:
Traceback (most recent call last):
File "G:\ade\build\sb_0-16486154-1442332453.92\Python-2.7.6-windows-x86-32bit\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27, in <module>
File "scripts\mysqlserverclone.py", line 211, in <module>
File ".\mysql\utilities\command\serverclone.py", line 180, in clone_server
File ".\mysql\utilities\common\tools.py", line 254, in get_mysqld_version
IOError: [Errno 13] Permission denied: 'version_check'
I has searched on google but found any similar problems.
Any help will be much appreciated !

A bit outdated, but it might help.
Run Mysql Utils console as administrator

Related

Unable to run or build images in podman

I recently tried to install podman on my mac.
podman machine init and podman machine start seem to work.
podman machine list
NAME VM TYPE CREATED LAST UP CPUS MEMORY DISK SIZE
podman-machine-default* qemu 2 hours ago Currently running 1 2.147GB 10.74GB
podman system connection list
Name Identity URI
podman-machine-default* /Users/k/.ssh/podman-machine-default ssh://core#localhost:65137/run/user/1000/podman/podman.sock
podman-machine-default-root /Users/k/.ssh/podman-machine-default ssh://root#localhost:65137/run/podman/podman.sock
So these seem to be OK too...
However, when I try commands like:
podman run -dt -p 8080:80 nginx I get the error:
podman --log-level=debug run -dt -p 8080:80 nginx
INFO[0000] podman filtering at log level debug
DEBU[0000] Called run.PersistentPreRunE(podman --log-level=debug run -dt -p 8080:80 nginx)
DEBU[0000] SSH Ident Key "/Users/k/.ssh/podman-machine-default" SHA256:<redacted> ssh-ed25519
DEBU[0000] Found SSH_AUTH_SOCK "/private/tmp/com.apple.launchd.ESzXNsREXi/Listeners", ssh-agent signer(s) enabled
DEBU[0000] DoRequest Method: GET URI: http://d/v3.4.4/libpod/_ping
DEBU[0000] Adding port mapping from 8080 to 80 length 1 protocol ""
DEBU[0000] Loading registries configuration "/etc/containers/registries.conf"
DEBU[0000] No credentials for https://index.docker.io/v1/ found
DEBU[0000] Found credentials for docker.io in credential helper containers-auth.json in file /Users/k/.config/containers/auth.json
Traceback (most recent call last):
File "/Users/k/Downloads/google-cloud-sdk/lib/gcloud.py", line 104, in <module>
main()
File "/Users/k/Downloads/google-cloud-sdk/lib/gcloud.py", line 62, in main
from googlecloudsdk.core.util import encoding
File "/Users/k/Downloads/google-cloud-sdk/lib/googlecloudsdk/__init__.py", line 23, in <module>
from googlecloudsdk.core.util import importing
File "/Users/k/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/util/importing.py", line 23, in <module>
import imp
File "/usr/local/Cellar/python#3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/imp.py", line 23, in <module>
from importlib import util
File "/usr/local/Cellar/python#3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/usr/local/Cellar/python#3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/usr/local/Cellar/python#3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 26, in <module>
import re as stdlib_re # Avoid confusion with the re we export.
File "/usr/local/Cellar/python#3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/re.py", line 124, in <module>
import enum
File "/Users/k/Downloads/google-cloud-sdk/lib/third_party/enum/__init__.py", line 26, in <module>
spec = importlib.util.find_spec('enum')
AttributeError: module 'importlib' has no attribute 'util'
DEBU[0000] Error looking up credentials for staging-k8s.gcr.io in credential helper containers-auth.json: error getting credentials - err: exit status 1, out: ``
Error: 1 error occurred:
* error getting credentials - err: exit status 1, out: ``
I'm at a loss as to why this exception is coming and why is it picking up google SDK. I don't think I have registered on GCR in podman....
Additionally, I logged into docker.io with podman (successful) but it still throws this error.
This is the same error if I try to build a dockerfile as well.
How do I debug this?
podman --version
podman version 3.4.4
MacOS Monterey 12.1 (Intel MacBook)

How to connect superset with mysql database?

I was trying to connect superset with mysql database with this SQLAlchemy URI:mysql://localhost:3306/mysql/database/table1 but not able to connect.
I was getting this error:
ERROR: {"error": "Connection failed!
The error message returned was:
No module named 'MySQLdb'", "stacktrace": "Traceback (most recent call last):
File \"/Users/akay/venv/lib/python3.7/site-packages/superset/views/core.py\", line 1703, in testconn
engine = database.get_sqla_engine(user_name=username)
File \"/Users/akay/venv/lib/python3.7/site-packages/superset/utils/core.py\", line 131, in __call__
value = self.func(*args, **kwargs)
File \"/Users/akay/venv/lib/python3.7/site-packages/superset/models/core.py\", line 923, in get_sqla_engine
return create_engine(url, **params)
File \"/Users/akay/venv/lib/python3.7/site-packages/sqlalchemy/engine/__init__.py\", line 479, in create_engine
return strategy.create(*args, **kwargs)
File \"/Users/akay/venv/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py\", line 87, in create
dbapi = dialect_cls.dbapi(**dbapi_args)
File \"/Users/arkay/venv/lib/python3.7/site-packages/sqlalchemy/dialects/mysql/mysqldb.py\", line 118, in dbapi
return __import__(\"MySQLdb\")
ModuleNotFoundError: No module named 'MySQLdb'
"}
Is there any way to connect to a MySQL database?
MySQLdb is not compatible with Python 3, You need to use pymysql.
Install pymysql:
$ pip install pymysql
Connect to mysql data source with below URI string.
mysql+pymysql://user:pass#host/databasename
Configure your database user with hostname=localhost
You need to install mysql-connector-python module:
$ pip install mysql-connector-python
Had similiar issue. I'm sure this will save time for some of you out there:
Use 127.0.0.1 instead of localhost.
Here is the perfect template for MySQL string:
SQLALCHEMY_DATABASE_URI = 'mysql://username:password#127.0.0.1:3306/schema-name'
Install MySQL:
pip3 install mysqlclient
Upgrade SQLAlchemy:
pip install sqlalchemy==1.3.24
Load DB:
superset db upgrade
Create Admin user:
superset fab create-admin
If you are using Docker try using host.docker.internal as host name. It worked for me

Couchbase server Restore

I am trying to restore a couchbase base from the backup file. I used the following command:
./cbrestore
/backup/2019-02-06T121650Z-full
http://127.0.0.1:8091
-u Administrator -p password
–bucket-source=my_bucket
–bucket-destination=my_bucket
When I run the command I get the following error:
s0 error: async operation: error: conn.send() exception:
[Errno 32] Broken pipe on sink: http://10.128.0.2:8091(my_bucket#10.128.0.2:8091)
error: conn.send() exception: [Errno 32] Broken pipe
I used:
couchbase-server5.1.1 community edition
My backup has the sync_gateways sync data also:
couchbase-sync-gateway 1.5.1 version

Unable to restore couchbase bucket using cbrestore

I am using Couchbase Server version 4.5.0 and trying to restore a saved backup version onto my local CB server. I am using macOS Sierra
Xcode Development tools are up to date
Python v2.7.10
I First created a backup by using this command
sudo ./cbbackup HOST:PORT ~/Documents/ -u ‘username’ -p ‘password‘ -b BUCKET_NAME
After this I tried restoring this backup onto local Couchbase server using this command
sudo ./cbrestore /path/to/backup/2017-01-24T121528Z/2017-01-24T121528Z-full/ http://localhost:8091 -u ‘USERNAME’ -p ‘PASSWORD’ --bucket-source=SOURCE_BUCKET_NAME --bucket-destination=DESTINATION_BUCKET_NAME
but I am getting following error.
Exception in thread s0:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/lib/python/pump_mc.py", line 91, in run
rv, batch, need_backoff = self.scatter_gather(mconns, batch)
File "/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/lib/python/pump_cb.py", line 72, in scatter_gather
rv, conn = self.find_conn(mconns, vbucket_id, msgs)
File "/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/lib/python/pump_cb.py", line 316, in find_conn
host_port = serverList[vBucketMap[vbucket_id][0]]
IndexError: list index out of range
If you took you're backup on a non-osx version of Couchbase and are restoring to an osx version then you need to use "-x rehash=1" with cbrestore. The reason is that the osx version of Couchbase is for development only and has less vbuckets then the standard (non-osx) Couchbase versions. The rehash flag tells cbrestore to deal with the different number of vbuckets.

mysql-workbench on Slackware 13.37 KDE error

After many hours of installing various libraries on my Slackware 13.37 i managed to start mysql-workbench (but I was wrong).
When launched from command line i get this warning:
bash-4.2# mysql-workbench
** Message: Gnome keyring daemon seems to not be available. Stored passwords will be lost once quit
Traceback (most recent call last):
File "/usr/local/lib/mysql-workbench/modules/wb_admin_ssh.py", line 43, in <module>
import paramiko
ImportError: No module named paramiko
Warning! Can't use connect with timeout in paramiko None
Traceback (most recent call last):
File "/usr/local/lib/mysql-workbench/modules/wb_admin_grt.py", line 27, in <module>
import wb_admin_main
File "/usr/local/lib/mysql-workbench/modules/wb_admin_main.py", line 29, in <module>
import wb_admin_monitor
File "/usr/local/lib/mysql-workbench/modules/wb_admin_monitor.py", line 21, in <module>
import wba_monitor_be
File "/usr/local/lib/mysql-workbench/modules/wba_monitor_be.py", line 26, in <module>
import wb_admin_ssh
File "/usr/local/lib/mysql-workbench/modules/wb_admin_ssh.py", line 119, in <module>
log_warning(_this_file, 'Cannot use connect with timeout in paramiko version %s\n' % paramiko.__version__)
AttributeError: 'NoneType' object has no attribute '__version__'
** Message: Failed loading module '/usr/local/lib/mysql-workbench/modules/wb_admin_grt.py' (python)
Ready.
the main program window appear and when i try to make a new connection i get this error :
Traceback (most recent call last):
File "/usr/local/share/mysql-workbench/sshtunnel.py", line 14, in <module>
import paramiko
ImportError: No module named paramiko
** (mysql-workbench-bin:2919): WARNING **: Tunnel manager could not be executed
and a popup appears:
Failed to Connect to MySQL at 127.0.0.1:3306 with user root Cannot
start SSH tunnel manager
mysql and ssh is installed and configured correctly:
bash-4.2# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.24 MySQL Community Server (GPL)
bash-4.2# ssh -v
OpenSSH_6.0p1, OpenSSL 0.9.8x 10 May 2012
can someone help me please !!!
It tells you that the python-paramiko module is missing. It is a python module for SSH connections; apparently that is used by one of the MySQL Workbench features. Get the slackware package here and install it executing
sudo installpkg paramiko-1.7.6-noarch-1gds.txz
Good luck!
Good answer above. On 64 bit systems, you have to install specific 32 bit libraries for workbench to work. E.g I had to install 32 bit python alongside the 64 bit python.
Also common errors include distribution specific errors. "/etc/mysql/my.cnf" not found, I created a soft link from /etc/my.cnf. Also had to create a folder at /root/.mysql/workbench/log for workbench to launch