how to link static jemalloc for mysql5.5 - mysql

I want to link static jemalloc library for oracle mysql5.5 .If mysql5.1 ,i can do it :
LDFLAGS=” -lrt -ljemalloc -lstdc++ ”
./configure –prefix=/usr/soft/install/mysql \
–with-mysqld-user=mysql \
–with-plugins=partition,blackhole,csv,heap,innobase,myisam,myisammrg \
–with-charset=utf8 \
–with-collation=utf8_general_ci \
–with-extra-charsets=gbk,gb2312,utf8,ascii \
–with-big-tables \
–with-fast-mutexes \
–with-zlib-dir=bundled \
–enable-assembler \
–enable-profiling \
–enable-local-infile \
–enable-thread-safe-client \
–with-readline \
–with-pthread \
–with-embedded-server \
–with-mysqld-ldflags=-all-static \
–without-query-cache \
–without-geometry \
–without-debug \
–without-ndb-debug
make && make install
But i can not find a cmake's option with it in mysql5.5.
What can i do?

Related

Convert log files to base64 and upload it using Curl to Github

I am trying to upload a file to Github using its API.
Following code works, but only with smaller size content which is approx less than 1MB.
tar -czvf logs.tar.gz a.log b.log
base64_logs=$(base64 logs.tar.gz | tr -d \\n)
content_response=$(curl \
-X PUT \
-u :"$GIT_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"$content_url" \
-d '{"message": "Log files", "content": "'"$base64_logs"'"}')
For content that is a bit large, I get the following error:
/usr/bin/curl: Argument list too long
Now, there is already a question on SO about this error message, and it says that to upload a file directly. See here: curl: argument list too long
When I try this, I get a problem parsing JSON error message.
tar -czvf logs.tar.gz a.log b.log
base64_logs=$( base64 logs.tar.gz | tr -d \\ ) > base64_logs.txt
content_response=$(curl \
-X PUT \
-u :"$GIT_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"$content_url" \
-d '{"message": "Log files", "content": #base64_logs.txt}')
Can anyone point me out where I am making mistake here? Thanks!
Use the base64 command rather than the #base64 filter from jq, because the later can only encode textual data and not binary data as from a .gz archive.
Pipe the base64 stream to jq to format it into a JSON data stream.
Curl will read the JSON data stream and send it.
# use base64 to encode binary data and -w0 all in one-line stream
base64 --wrap=0 logs.tar.gz |
# JSON format from raw input
jq \
--raw-input \
--compact-output \
'{"message": "Log files", "content": . }' |
# Pipe JSON to curl
curl \
--request PUT \
--user ":$GIT_TOKEN" \
--header "Accept: application/vnd.github.v3+json" \
--header 'Content-Type: application/json' \
--data-binary #- \
--url "$content_url"

Ignore errors while loading to Mysql from Pyspark

In redshift we can have maxerror Option
df.write.option("url", jdbc_url) \
.option("dbtable", tbl) \
.option("tempdir", tmp_folder_rs) \
.option("aws_iam_role", rs_iam) \
.option("extracopyoptions", "**maxerror as 100000** blanksasnull") \
.mode("append") \
.save()
which gives it a tolerance of some records while loading.
Do we have similar options for MYSQL. My write to mysql is as below
job_status_event_req_cols.write.format("jdbc").option("url", "jdbc:mysql://test.us-west-1.vpce.amazonaws.com/test").option("driver", "com.mysql.jdbc.Driver").option("dbtable", "employee").option("user", "writer").option("password", "test").mode('append').save()

How to capture terminal screen output (with ansi color) to an image file?

I tried the following command to capture the output of a command (grep as an example) with color. But the result is shown as ^[[01;31m^[[Ka^[[m^[[K.
grep --color=always a <<< a |
a2ps -=book -B -q --medium=A4dj --borders=no -o out1.ps &&
gs \
-sDEVICE=png16m \
-dNOPAUSE -dBATCH -dSAFER \
-dTextAlphaBits=4 -q \
-r300x300 \
-sOutputFile=out2.png out1.ps
Is there a way to capture the color in the image? Thanks.

Sending HTML by cURL on MAILGUN

I tried to send this by email. I tried a lot of ways and always I obteined the same thing: an error.
http://goto-21.net/campaign/htmlversion?mkt_hm=0&AdministratorID=47507&CampaignID=58&StatisticID=62&MemberID=733807&s=994508d6292a660150ccc60c3f0310d4&isDemo=0
I tried with this:
curl -s --user 'api:key-3ax6xnjp29jd6fds4gc373sgvjxteol0' \
Xhttps://api.mailgun.net/v2/samples.mailgun.org/messages \
-F from='Excited User ' \
-F to='foo#example.com' \
-F cc='bar#example.com' \
-F bcc='baz#example.com' \
-F subject='Hello' \
-F text='Testing some Mailgun awesomness!' \
-F html=' CODE HERE ' \
And this:
curl -s --user 'api:key-3ax6xnjp29jd6fds4gc373sgvjxteol0' \
Xhttps://api.mailgun.net/v2/samples.mailgun.org/messages \
-F from='Excited User ' \
-F to='foo#example.com' \
-F cc='bar#example.com' \
-F bcc='baz#example.com' \
-F subject='Hello' \
-F text='Testing some Mailgun awesomness!' \
--form-string html=' CODE HERE ' \
But it doesnt work...Always ''syntax error''
Anyone can help me?
Thank you!
Use the following cURL command to send HTML emails using the command line.
Replace the uppercase parameter with your own and you're ready to send!
curl -s --user 'api:YOUR-API-KEY' https://api.mailgun.net/v2/YOURDOMAIN/messages -F from='YOU#YOURPROVIDER.COM' -F to=RECEIVER#PROVIDER.com -F subject='Hello World with HTML' -F html='<html><head><title>Hello</title></head><body>Hello <strong>World</strong></body></html>' -F text='Hello world'
What this does is send an email from an address attached to your domain to a receiver sending html and plain text version as a fall back!
Happy mailgunning
Best,
the origin request is looks like:
curl -s --user 'api:key-3ax6xnjp29jd6fds4gc373sgvjxteol0' \
https://api.mailgun.net/v3/samples.mailgun.org/messages \
-F from='Excited User <excited#samples.mailgun.org>' \
-F to='devs#mailgun.net' \
-F subject='Hello' \
-F text='Testing some Mailgun awesomeness!'
but you have a big X before https.
curl -s --user 'api:key-3ax6xnjp29jd6fds4gc373sgvjxteol0' \
-------> X <----- https://api.mailgun.net/v2/samples.mailgun.org/messages \ -F from='Excited User ' \ -F to='foo#example.com' \ -F cc='bar#example.com' \ -F bcc='baz#example.com' \ -F subject='Hello' \ -F text='Testing some Mailgun awesomness!' \ --form-string html=' CODE HERE ' \
maybe this cause an error

what are flags in mysql?

I just wanna ask, what are those things called as "flags" in mysql ?
What are they, kindly explain and how they are used.
mysql flags are used by the compiler and set the enviroment you wish to work in.
There's flags such as:
'--with-archive-storage-engine'
wgich does what it states, it would start mysql process but also start the system in archive able content mode
Some more examples:
'--prefix=/usr/local/mysql' \
'--disable-dependency-tracking' \
'--enable-assembler' \
'--localstatedir=/usr/local/mysql/data' \
'--libexecdir=/usr/local/mysql/bin' \
'--libdir=/usr/local/mysql/lib' \
'--enable-local-infile' \
'--enable-shared' \
'--enable-thread-safe-client' \
'--with-archive-storage-engine' \
'--with-big-tables' \
'--with-comment=MySQL Community Server (GPL)' \
'--with-extra-charsets=complex' \
'--with-innodb' \
'--with-mysqld-ldflags=-all-static' \
'--with-readline' \
'--with-server-suffix=-standard' \
'--with-unix-socket-path=/tmp/mysql.sock' \
'--with-zlib-dir=bundled' \
'--without-debug' \
'--without-docs' \
'--without-man'