This requires IPython 3, pexpect.
This kernel interact with MySQL Command-Line
Tool via
pexpect.
- Use pip:
pip install git+https://github.com/mmisono/ipython_mysql_kernel
- Checkout the source:
git clone https://github.com/mmisono/ipython_mysql_kernel
thenpython setup.py
or make~/.ipython/kernels/mysql/kernel.json
which contents is as follows:
{
"argv": [
"python",
"/path/to/ipython_mysql_kernel/kernel.py",
"-f",
"{connection_file}"
],
"display_name": "mysql"
}
If you use pip
or python setup.py
, kernel files are created at ipython's
kernel directory.
(see docs
for more detail).
Please don't forget to remove these files when uninstall this.
This kernel reads mysql config from ~/.ipython/mysql_config.json
.
Default config is as follwos:
{
"user" : "root",
"port" : "3306",
"host" : "127.0.0.1",
"charset" : "utf8"
}
You can specify "password" if needed. The permission of this file should be set 600.
ipython console --kernel mysql
or ipython notebook
then select mysql kernel.
- Use non-proportional fonts for better output in ipython notebook. You can set custom css via ipython profile.
for example, create
~/.ipython/profile_default/static/custom/custom.css
as following:
div .output_subarea pre { /* output font */
font-family: Osaka-Mono, "MS Gothic", monospace;
font-size: 12pt;
overflow: auto;
word-wrap: normal;
white-space: pre;
}
overflow
option is needed for horizontal scroll bar in the output area;
- flexible config change
- better completion (field completion)
- syntax check
- helper command
new BSD license