libmysqlclient15-dev on macs? - mysql

Does OSX need an install of libmysqlclient15-dev? I'm trying to compile a gem that is failing and a lot of sources says to install "libmysqlclient15-dev" but I only see this for Linux, not OSX. Am I missing something here?

brew install mysql
fixed this for me

I know this is old, but google got me here. So let's say the solution in 2018 for python3 on OSX.
brew install mysql-client
echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
pip install mysqlclient

I just had the same problem and only got a partial working solution.
Here are the steps I made to make it work:
brew install mysql-client
brew install mysql-connector-c
IF YOU HAVE ZSH:
echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
ELSE:
echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
Now for the installation itself:
LDFLAGS=-L< your openssl lib folder location > pip install mysqlclient==< version >
for example:
LDFLAGS=-L/usr/local/opt/openssl/lib pip install mysqlclient==1.3.12

If you are using the mysql dmg file to install mysql you will need to edit your ~/.bash_profile and include this:
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH

brew install mysql
then
arch -x86_64 gem install mysql2 -v 0.5.3 -- --srcdir=/usr/local/mysql/include
Afterwards I was able to run bundle install.
Copied from Bragadeesh Jegannathan's blog post

Yes you will need to install this. For example if you are trying to install the mysql gem you will need the headers for the mysql library. This is because some gems need to compile native extensions, so they need the header files for any 3rd party libraries that the extensions uses.
On Mac OS X I recommend using MacPorts to manage the installation of these libraries/headers.

Those instructions are for Debian type Linuxes. The closest thing to Debian for OS X is Fink. After getting that installed and set up, you can say fink install mysql-unified-dev to get essentially the same thing as asking for libmysqlclient15-dev on a Debian or Ubuntu type system.
Beware that Fink installs its packages in /sw, and not all build scripts know to look there for libraries and headers. You might have to give custom build options to get it to figure this out.
A path that may be more successful is to simply download the MySQL 5.0 package for Mac OS X. That should include the same development files as libmysqlclient15-dev, and as a bonus will put them in places more likely to be found by your gem.
(Why 5.0, by the way? Because that's what corresponds to ABI version 15, which your package apparently requires. Maybe it will in fact work with 5.1, or 5.4, or 6.0, but that would be a risk you'd have to decide to take on your own.)

Related

Trying to access MySQL with perl script [duplicate]

Install information:
Using DBI 1.608 (for perl 5.008009 on x86_64-linux) installed in /usr/local/lib/perl5/site_perl/5.8.9/x86_64-linux/auto/DBI/
error information:
[root#datacenterETL DBD-mysql-4.020]# perl ../testConnect.pl
install_driver(mysql) failed: Can't locate DBD/mysql.pm in #INC (#INC contains: /usr/local/lib/perl5/5.8.9/x86_64-linux /usr/local/lib/perl5/5.8.9 /usr/local/lib/perl5/site_perl/5.8.9/x86_64-linux /usr/local/lib/perl5/site_perl/5.8.9 .) at (eval 3) line 3.
Perhaps the DBD::mysql Perl module hasn't been fully installed, or perhaps the capitalisation of 'mysql' isn't right.
It looks like you're using Linux. In that case, you might find it easier to install a pre-packaged version of the module.
On a Red Hat derivative try yum install perl-DBD-mysql; on a Debian derivative try apt-get install libdbd-mysql-perl.
Perhaps the DBD::mysql perl module hasn't been fully installed
...so install it.
cpan DBD::mysql
Or since you don't have internet access,
perl Makefile.PL
make
make test
make install
You'll need MySQL's development header files installed first, as per INSTALL
any error related to DBD::mysql error has not installed fully. Please run the below code in super user permission.
apt-get install libdbd-mysql-perl
As is was not able to comment (yet), I want to add something for the Mac Users.
I hat to add the --force command to install the everything properly as i have no local mySQL installation for the tests to pass.
/usr/bin/cpanm --force DBD::mysql worked for me. (Mac OS 10.9.2, Perl 5.12.4)
I've been tried perl -MCPAN -e shell on my mac OSX 10.8.5, but this didn't work.
I tried sudo perl -MCPAN ..., but didn't work too. I changed my ~.bash_profile to include
LD_RUN_PATH=/usr/local/mysql-5.6.13-osx10.7-x86_64/lib export LD_RUN_PATH
LD_LIBRARY_PATH=/usr/local/mysql-5.6.13-osx10.7-x86_64/lib export LD_LIBRARY_PATH
lines, and I tried -MCPAN again, with and without sudo, but this didn't work too.
I read some posts and I tried "get Bundle::DBD::mysql" in -MCPAN command line to download it and install with Makefile. Then, I entered the ~./cpan/build directory and I did a Makefile, but the make command didn't work. I tried Makefile with --testuser and --testpassword that I just had been configure in mysql. I entered the site https://discussions.apple.com/thread/3932531?start=0&tstart=0&fb_source=message that is informed in README doc of ./cpan/bundle, but I already had all command line tools of xCode installed and didn't work for me too.
Why don't do sudo perl -MCPAN -e shell and to force to install Bundle::DBD::mysql? This worked well and I got the installation.

How to install expect and tcl on linux RHEL server 6.5

I am new to linux and i have few expect scripts to execute. I read few blogs on how to install expect and tcl. The command i am trying is
sudo yum install expect
sudo yum install tcl
I am getting
No package expect available
No package tcl available
It seems RHEL should have tcl and expect prebuilt but this is not the case in my version of linux.
How should i proceed from here ?
Help will be highly appreciated..Thanks :)
Install the development tools:
yum groupinstall "Development tools"
then
./configure
make
make install
should be good to go.
Have you tried this? In this way you will be able to compile from source.
1) Download the expect package from the below link
http://sourceforge.net/projects/expect/
2) Install the required dependecy packages "Tcl/Tk" language toolkit
# yum install tcl
3) Install the "expect" package using the below commands
# tar -zxvf expectx.xx.tar.gz
# ./configure
# make
# make install
I tried the following links and it worked for me. http://www.linuxfromscratch.org/blfs/view/svn/general/tcl.html http://www.linuxfromscratch.org/blfs/view/svn/general/expect.html
Try ActiveTcl from ActiveState:
http://downloads.activestate.com/ActiveTcl/releases/8.6.4.1/ActiveTcl8.6.4.1.299124-linux-x86_64-threaded.tar.gz
You can add EPEL Repo
On 32-Bit -
# rpm -Uvh http://epel.mirror.net.in/epel/6/i386/epel-release-6-8.noarch.rpm
On 64-Bit -
# rpm -Uvh http://epel.mirror.net.in/epel/6/x86_64/epel-release-6-8.noarch.rpm
and then you can use yum to install.
Also you can compile from source or get from ActiveState like in previous answers.

how can i install jruby alongside ruby

i first installed jruby using the sudo apt-get install jruby command, which succeeded but it did gave me 1.5.6 version when i wanted a later version. So i uninstalled it and used rvm install jruby command and i was able to install jruby version 1.7.19 but after installing it, my ruby applications,which were funtioning right started producing errors complaining of missing gems like mysql2 gem missing,run bundle install. i run bundle install but nothing i did seemed to help, i was getting nowhere.
When i asked for the ruby version, i was receiving the jruby version instead, its lyk jruby over shadowing ruby,,,, So i decided to uninstall jruby, reinstall ruby and now ruby is functioning as well as before.
Can anyone help me with the ubuntu commands which can help me install jruby alongside ruby, so that both work well without any errors???
Am requesting for serious help please
I usually prefer rbenv over rvm for running multiple versions of Ruby on the same machine. Here is sample install/usage steps:
Install rbenv git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
Install ruby-build git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
Modify your .bashrc echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
Restart your shell
Install rubies. e.g. rbenv install jruby-1.7.20
Rehash (create new rbenv shims. You'll need to run this anytime you install a gem that adds a command) rbenv rehash
You can list the Ruby versions available to install with rbenv install -l
You can set the default global ruby version with rbenv global jruby-1.7.20.
You can also pass "system" instead of an installed Ruby if you want the default to be the OS installed version of Ruby.
You can change Ruby version on the fly with rbenv shell 1.9.3-p551
See here (https://github.com/sstephenson/rbenv#command-reference) for a lot more detail and documentation.
Edit: I was assuming you're using Ubuntu, hence the edit of .bashrc. If you're using another OS you may need to change that to .bash_profile
Thanks for that answer. I have also found out that it is soo possible to have jruby and ruby installed concurrently using rvm. After installing the various versions or languages say ruby and jruby, only the default language and version is running in the terminal as current so you have to run the command 'rvm list' to show you the various installed versions after which you run 'rvm use language-X.X.XX' say rvm use jruby-1.7.20.1 to make jruby-1.7.20.1 run as the current in that terminal.
You can also run another version in a different terminal concurrently but please note, you have to run the command rvm use every time you open up a new terminal, else you make that version default.

mysql 5.5 on centos 6.4

I have a requirement for MySQL 5.5, and the box is a CentOS 6.4 64-bit VM.
MySQL 5.1.69 is installed, and won't let me install any of the RPMs from the 5.5 RPMs..
MySQL-client-5.5.32-1.el6.x86_64.rpm
MySQL-devel-5.5.32-1.el6.x86_64.rpm
MySQL-embedded-5.5.32-1.el6.x86_64.rpm
MySQL-server-5.5.32-1.el6.x86_64.rpm
MySQL-shared-5.5.32-1.el6.x86_64.rpm
MySQL-shared-compat-5.5.32-1.el6.x86_64.rpm
MySQL-test-5.5.32-1.el6.x86_64.rpm
So I run yum -y remove mysql and then try to install the newer version. I first of all run
rpm -ivh MySQL-shared-5.5.32-1.el6.x86_64.rpm
rpm -ivh MySQL-shared-compat-5.5.32-1.el6.x86_64.rpm
So far so good. I then try to install the server.
rpm -ivh MySQL-server-5.5.32-1.el6.x86_64.rpm
And I get this..
file /usr/share/mysql/romanian/errmsg.sys from install of MySQL-server-5.5.32-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.69-1.el6_4.x86_64
... and so on. If I google some of those errors, I get this page from StackOverflow..
Installing mysql-libs on server with MySQL-Server5.5
.. but if I look at the advice, it says to install the MySQL-shared-compat-5.5.32-2.el6.x86_64.rpm. But it's already installed. :(
Any advice would be welcome. Thank you.
One way is to install all the RPMs at the same time with yum install MySQL*.rpm, which ideally should take care of all package dependencies and upgrades.
You can also get around this problem by using the --replacefiles option to RPM:
rpm -ivh --replacefiles MySQL-server-5.5.32-1.el6.x86_64.rpm
That uses the error message language files from the server package to overwrite those in the 5.1 version that comes with CentOS.
Had this issue with webtatic repository.
Using remi, epel and rpmforge repository saved me the trouble.
Here is the link I referred :
Cent OS 6.4, Php 5.4, Mysql 5.5 - HowTo

Installing sphinx on Dreamhost

I'm following this tutorial: http://hughevans.net/2009/03/10/thinking-sphinx-dreamhost
I'm run into an issue when I run:
./configure --prefix=$HOME/local/ --exec-prefix=$HOME/local/
I get an error: "cannot find MySQL include files."
I've checked and cant find mysql_config, so I'm guessing the mysql-devel package isn't installed.
My next step is to install the mysql-devel package from source, but I'm thinking that I may be missing something.
Has anyone found a solution for this issue?
(I'm using a VPS)
My next step is to install the mysql-devel package from source
Why from source?
Suggest just using a package manager to install the package.
I solved my problem by using a different user with root access.
With that user I installed sphinx with APT.
sudo apt-get install sphinxsearch