Issues with MySQL on Yosemitie - mysql

I've pulled down a new Django repository that uses MySQL and after installing it I'm getting some weird errors when I go to run the syncdb command
I initially get the following error
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Users/splashlin/Developer/project/venv/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: /usr/local/lib/libmysqlclient.18.dylib
Referenced from: /Users/splashlin/Developer/project/venv/lib/python2.7/site-packages/_mysql.so
Reason: image not found
I've tried fixing it with
sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib /Library/Python/2.7/site-packages/_mysql.so
but just get
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: /Library/Python/2.7/site-packages/_mysql.so (No such file or directory)
Anyone have any ideas on how to move forward to resolve the issue? Pretty stuck right now. Thanks!

Try to download and install (or reinstall) the MySql's connector for Python
http://dev.mysql.com/downloads/connector/python/
Greetings

Related

Integrating Apache Superset and Apache Drill

I installed Apache Drill through the link in the Drill Documentation. Apache Drill works fine. I also installed and got Apache Superset running using docker. Superset also works totally fine.
But my goal is to integrate Superset and Drill together. The only tutorial I was able to find was a tutorial from Dataist. When following this tutorial they ask us to add a database.
Since I am running both Drill and Superset in my local machine they ask us to type drill+sadrill://localhost:8047/dfs/test?use_ssl=False as the SQLAlchemy URI. They ask us to test the connection by pressing test connection.
When pressing test connection I get an error message as follows.
ERROR: {"error": "Connection failed!\n\nThe error message returned was:\nCan't load plugin: sqlalchemy.dialects:drill.sadrill", "stacktrace": "Traceback (most recent call last):\n File \"/home/superset/superset/views/core.py\", line 1755, in testconn\n engine = database.get_sqla_engine(user_name=username)\n File \"/home/superset/superset/utils/core.py\", line 132, in __call__\n value = self.func(*args, **kwargs)\n File \"/home/superset/superset/models/core.py\", line 911, in get_sqla_engine\n return create_engine(url, **params)\n File \"/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/__init__.py\", line 435, in create_engine\n return strategy.create(*args, **kwargs)\n File \"/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py\", line 61, in create\n entrypoint = u._get_entrypoint()\n File \"/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/url.py\", line 172, in _get_entrypoint\n cls = registry.load(name)\n File \"/usr/local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py\", line 240, in load\n \"Can't load plugin: %s:%s\" % (self.group, name)\nsqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:drill.sadrill\n"}
Can someone figure out why I am getting this error. And also if there are any other tutorials to follow which give a better idea on how to set up Drill and superset.
I have encountered a similar issue while trying to connect elasticsearch. I guess the docker image you used was amancevice/superset. This issue cause because your image is not using the latest SQLAlchemy, SQLAlchemy-Utils packages. Upgrade or reinstall these packages to fix the issue.
To uninstall:
pip uninstall SQLAlchemy
pip uninstall SQLAlchemy-Utils
To install again (latest version):
pip install SQLAlchemy
pip install SQLAlchemy-Utils
I have reported this issue here https://github.com/amancevice/docker-superset/issues/158 maybe it get fixed with the upcoming images.

Ruby on Rails mysql2 gem troubleshot

I have created new ruby on rails project with mysql database.
I have run mysql server by running mysql.server start
When I try to run rake db:create, I got following error:
dyld: lazy symbol binding failed: Symbol not found: _mysql_init
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
Expected in: flat namespace
dyld: Symbol not found: _mysql_init
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
Expected in: flat namespace
Anybody can solve this issue?
Please reachout me. Regards.
The salient details are that you need to update the DYLD_LIBRARY_PATH to include /usr/local/mysql/lib. The easiest way of doing that is to add the following to your ~/.bashrc file:
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"
I went into a little more detail in a blog post here: http://www.bartbusschots.ie/blog/?p=2186

Error when trying to add subdomain or add databases with cPanel

cPanel is throwing up an error everytime I try to add or edit an existing subdomain. The same error is showing up when I try to add a new database.
Cpanel::AdminBin::_get_cpwrapd_connection could not connect to /usr/local/cpanel/var/cpwrapd.sock
PHPMyAdmin, FTP and SSH are all working perfectly, so the problem is something to do with cPanel. The server is a VPS with GoDaddy. I was installing a program running on Ruby 1.8.7, and this error started showing up after I installed the program. I have tried /scripts/installruby but that's giving me this error:
The internal error was:
(RegexpError) Stack overflow in regexp matcher: /.*((?>\/\*.*?\*\/\s+))
([\w\.\s]+\s* = \s+)?rb_define_(class|module).*?"(Mongrel)"/mx
ERROR: While generating documentation for mongrel-1.1.5
... MESSAGE: Stack overflow in regexp matcher: /.*((?>\/\*.*?\*\/\s+))
([\w\.\s]+\s* = \s+)?rb_define_(class|module).*?"(Mongrel)"/mx
... RDOC args: --ri --op /usr/local/rvm/gems/ruby-1.8.7-p374/doc/mongrel-1.1.5/ri --line-numbers --title Mongrel --main README lib ext CHANGELOG COPYING lib/mongrel/camping.rb lib/mongrel/cgi.rb lib/mongrel/command.rb lib/mongrel/configurator.rb lib/mongrel/const.rb lib/mongrel/debug.rb lib/mongrel/gems.rb lib/mongrel/handlers.rb lib/mongrel/header_out.rb lib/mongrel/http_request.rb lib/mongrel/http_response.rb lib/mongrel/init.rb lib/mongrel/rails.rb lib/mongrel/stats.rb lib/mongrel/tcphack.rb lib/mongrel/uri_classifier.rb lib/mongrel.rb LICENSE README --title mongrel-1.1.5 Documentation --quiet
die [installruby] Failed command: /usr/bin/gem install mongrel-1.1.5.gem --local
exit level [die] [pid=5273] (Failed command: /usr/bin/gem install mongrel-1.1.5.gem --local)
I solved the problem by rebooting cPanel, using /etc/init.d/cpanel restart

Error: Cannot retrieve repository metadata (repomd.xml) for repository: boxgrinder-noarch

I am trying to run yum update on my machine and I get this error.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: boxgrinder-noarch. Please verify its path and try again
Any idea what is wrong?
I use Fedora 15
cd /etc/yum.repos.d/
perl -i -ape 's/https:/http:/g' *.repo
worked for me.
I have the same problem in Fedora 14.
When I changed the *.repo file in /etc/yum.repos.d, it works.
"Change all 'https' to 'http' in each *.repo file"
such as:
[fedora]
name=Fedora $releasever - $basearch
failovermethod=priority
baseurl=ftp://ftp.cru.fr/pub/linux/fedora/releases/11/Everything/x86_64/os/
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
enabled=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearchthe
change is like this
"mirrorlist=https:"--->"mirrorlist=*http:*"
find out the repo which is causing a problem in your case it is
box-grinder, remove the repo or fix it.
cd /etc/yum.repos.d/
mv /etc/yum.repos.d/box-grinder.repo /etc/yum.repos.d/box-grinder.repo.disabled
I was able to get rid of this error by removing the boxgrinder repos
I removed these files
boxgrinder-nightly.repo boxgrinder-noarch.repo boxgrinder-x86_64.repo
from /etc/yum.repos.d/ directory.
[ percona ]
Attempting to get the percona-release-0.1-3.noarch.rpm
The issue I had:
http://repo.percona.com/release/6.6/RPMS/noarch/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: percona-release-noarch. Please verify its path and try again
What I did to fix the issue:
sed -i 's/$releasever/5/g' /etc/yum.repos.d/percona-release.repo
You won't see a response.
yum clean all
yum update
This should solve your problem
What this does? sed overwrites whatever the percona-release.repo file says with s/$releasever/5/g incase the yum clean all doesn't catch it or some other error occurs.
yum repo shell drupal percona fedora

Connect to mysql from node.js app, error: "dyld: lazy symbol binding failed: Symbol not found: _mysql_init"

I use OSX 10.6.8 and MySQL from XAMPP.
When I run this node.js app (app.js):
var mysql = require('mysql-libmysqlclient');
var conn = mysql.createConnectionSync();
conn.connectSync('127.0.0.1', 'root', '', 'database_name');
I see this output:
Airs0urce:nodejs airs0urce$ node app.js
dyld: lazy symbol binding failed: Symbol not found: _mysql_init
Referenced from: /Applications/XAMPP/xamppfiles/htdocs/myproject/nodejs/node_modules/mysql-libmysqlclient/build/Release/mysql_bindings.node
Expected in: dynamic lookup
dyld: Symbol not found: _mysql_init
Referenced from: /Applications/XAMPP/xamppfiles/htdocs/myproject/nodejs/node_modules/mysql-libmysqlclient/build/Release/mysql_bindings.node
Expected in: dynamic lookup
Trace/BPT trap
Already tried couple solutions after googling.
Added mysql libs from XAMPP directory to include path this way:
export DYLD_LIBRARY_PATH=/Applications/XAMPP/xamppfiles/lib/mysql:$DYLD_LIBRARY_PATH
tried to install mysql5-devel using MacPorts, but no luck, building failed:
Airs0urce:~ airs0urce$ sudo port install mysql5-devel
---> Computing dependencies for mysql5-devel
---> Building mysql5-devel
Error: Target org.macports.build returned: shell command failed (see log for details)
Log for mysql5-devel is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_mysql5-devel/mysql5-devel/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>
There is log file if you want to see: http://dl.dropbox.com/u/1875424/main.log
This is because of a config issue on Mac OS X Lion (10.7): lib/libmysqlclient.18.dylib (mysql 5.5 and above).
Step 1:
Make sure you set the path in ~/.profile
export ARCHFLAGS=-arch x86_64
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH
Step 2:
I am using rvm so, I used the following command:
rvmsudo ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config --with-opt-lib=/usr/local/mysql/lib
which has solved the issues with rails application on Mac lion and mysql x86_64.
I futzed around with this for a ton of time including setting the DVLD library path and copying the library into /usr/lib.
sudo cp /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib
Heck, anything to get it working. Finally I tried clearing the default for 64 vs 32 bit and it worked!
defaults delete com.apple.versioner.perl
Not sure if my perl is 64 or 32 bit, but my db is 64 bit and just using the default default seems to work better ;-)