Home > Setup > Database creation script for *ubuntu users

Database creation script for *ubuntu users

January 11, 2009

For those ubuntu users that need the database creation script, this is for lemonpos 0.5.

click here to get the file, save it somewhere and open a terminal/console and run the next command (inside the folder where you downloaded the file):

cat lemon_mysql.sql | mysql -u root -p

Of course provide the mysql’s root password when asked.

The script will create an EMPTY database with only one user (admin) with default password (linux). Use squeeze to create more users, to add products and offers, etc..

i hope this helps.

Categories: Setup Tags:
  1. Dan
    October 28, 2009 at 8:55 am

    Your link to the database is dead.

    • January 24, 2010 at 9:25 pm

      Thats because its so old… you must try using a recent version of lemon. currently the 0.9

  2. NewtoLemon
    November 11, 2009 at 12:59 am


    I am looking for the database creation script for Ubuntu. Can you email that script to me as the link is unavailable. Thanks very much and keep up the good work.


  3. NewtoLemon
    November 12, 2009 at 11:26 pm


    The link for the Database setup is not active. Can you please send me an email with the script attached as I would like to install your product on Ubuntu. Thanks.


    • January 24, 2010 at 9:24 pm

      There is a new release. 0.9 version with new database. try it. Still waiting the ubuntu packagers.

  4. mac
    February 9, 2010 at 11:40 am

    I’ve taken the plunge in Linux with Ubuntu, and I’m trying to install Lemon. LOTS of questions, but here’s what I’ve done:
    -Thru Synaptic Package Manager I downloaded Lemon, Squeeze, Mysql, Qt, Kde4, Cmake and bunch of files associated to them——- Lemon 0.8, Squeeze appear in Applications but when started, a database config window shows up and asks for: ‘server, username, password and database name’ which are already filled, even the password…..WHAT TO DO?
    I’ve also downloaded Lemon 0.9….How to install from this file?
    I’ve read the install wikis…not much luck.

    Thanks to anyone who can help….step by step.

    • February 9, 2010 at 8:22 pm


      Well, first of all: The newer version is better (new features, bugfixes). The newest version from sourceforge is 0.9.1 updated some hours ago.

      If at the startup, lemon/squeeze is presenting the database configuration dialog, it means that its unable to connect to the database sever.
      It may be one or more of the following:
      1.- mysql is not installed.
      2.- mysql is not running.
      3.- mysql is not working properly (some misconfiguration).
      4.- you (or the .deb installer if is the case) have not run the database creation script.
      5.- you may have changed the user/password or database name.
      6.- some firewall or mysql configuration is rejecting connections.

      So, check the above points and try again.

      The wiki install howto is step by step…
      start at the http://sourceforge.net/apps/mediawiki/lemonpos/index.php?title=Installation_Guide and at step ‘preparing to install’ follow the link to the Kubuntu Specific istallation and then return to the Installation Guide.

  5. mac
    February 11, 2010 at 7:22 am

    Thanks for your reply,

  6. mac
    February 21, 2010 at 8:07 am

    Hello again,
    Quick question: I’ve installed Mysql; how does it need to be set up in order to work with Lemonpos? More specifically:
    – Does Mysql need to be setup to start automatically at each system startup? and as which user? root or preferably as a user with limited privileges?
    I’m thinking that someone else would use Lemon, but not have the ability to change things.

    • February 21, 2010 at 2:03 pm

      MySQL in most distributions, run as a service by its own user (mysql user). So Distributions do the needed steps for doing this (http://dev.mysql.com/doc/refman/5.0/en/changing-mysql-user.html).
      In ubuntu when installing mysql its configured to run at boot, if not, you can add it to the services (in the system configuration menu). Its convenient to run it at boot, as you dont need to run it manually each time you need it.
      In Archlinux, when installing mysql you need to add it to the daemons list to run at boot.

  7. mac
    February 21, 2010 at 3:51 pm

    More questions…
    Started Squeeze, entered categories, but for products: cannot get the OK button after filling some of the fields…why?
    what should the Saqueeze setup look like? I have ‘General’ and ‘Database’ (which bears a ? logo) categories. In ‘Database’, the field of Password is filled but I don’t know what it is.
    And…Lemon’s window is larger than my screen and so part of it is always out of the screen. How to adjust?

    • February 21, 2010 at 10:26 pm


      The OK button is enabled when filled the requiered information for a product, if you filled everything maybe press “TAB” key for going to other field and see if its enabled (this happens, because the event that fires the enable action is fired once a field lost the focus – changing form the field to another-…

      For Configuration, the General tab is for the security mode type, the grid (hide/show), and the min/max values for the stock alert on squeeze.
      The Database (is a logo is missing is because it maybe belongs to other not installed app on your system) is for the database connection data: the username and password for it, and the server where mysql is running. It is populated by default values (user/password that are created with the creation script) and ‘localhost’ for the server (which is your own computer).

      For the lemon’s bigger screen, you can read this post on the wiki: https://sourceforge.net/apps/mediawiki/lemonpos/index.php?title=Users_tips#Lemon.27s_window_is_too_big_for_my_screen

  8. mac
    February 22, 2010 at 12:39 pm

    Thanks again for replying. I got the product entry problem taken care of, then entered a bunch of products (by the way I’m setting Lemon to be used in a restaurant/café) and Lemon sees them…no problem. However:
    -Still got the problem with Lemon window being bigger than my display. I followed your link but didn’t help. Clicking on some part of the window makes it shift from one side to the other. I can move the icon palettes but the shifting window makes it difficult to do that.
    -Is it possible to add pix to Categories?
    -and can we change the currency type…to say, Euros?
    Till next time… 🙂

    • February 22, 2010 at 1:44 pm


      Please consider using the mailing list, its easier for me to answer, and to people to follow a thread of interest.

      Its not possible to add pix to categories now.. and because of the way that categories are used in lemon, a pix its not usable.. I imagine you want to have those images on screen like products grid.

      The Currency is a system wide config (kde), lemon uses the currency that was configured with kde. You can use “systemsettings” application to change “Language and Regional” Settings.

      The problem with screen size and lemon window is an old problem. Its a problem with the layout system… i have tried to make it work on small screens without sucess, it keeps rejecting a size lower to 1024×768… days trying this. As time is limited, I decided to give up on this, given that only netbooks (or any MID) have limited screen resolutions.
      Still on 1024×768 pixels there is needed to resize the toolbars and move them as said on the tips page on the wiki..

  9. mac
    February 22, 2010 at 12:47 pm

    One more question:
    Lemon asks for Admin password everytime it starts. How to set it up so that an employee starts the machine and Lemon without needing to know Admin’s password?
    p.s. I have setup another vendor beside Admin, but it asks Admin’s password regardless.


  10. mac
    February 23, 2010 at 4:48 am

    OK for the mailing list, just signedup. will continue on there

    • April 8, 2010 at 10:32 pm


      Are you using lemonPOS and mysql in the same computer (localhost) ?
      Is the libqt4-sql-mysql package installed? the package can have another name on suse…

      Try running lemon from the console and copy paste the output to try to guess what is happening.

  11. Victor
    April 8, 2010 at 9:34 pm

    Dear All, i have problem connecting to the database i use suse 11.2 and i have my mysql running i did the instruction in the wiki and the file and still squeeze trying to connect.

    and still didnt find the problem i googled a lot i use lemon v.8 rpm from suse.

    i checked the created table in mysql its ok as what in lemon_mysql.sql password is ok and the user ok.

    the firewall is off what other can i do.


  12. Victor
    April 9, 2010 at 5:38 pm

    i solve the problem lib for qt sql

  13. Victor
    June 26, 2010 at 1:07 pm

    Am using lemon 0.9.2 on ubuntu 10.04 but squeeze freezes when adding users does anybody know the solution

    • June 26, 2010 at 2:08 pm

      install the 0.9.3rc version.

      Two options:

      1.- from source code, get it from the git repository (persa branch). See the wiki.
      2.- from the precompiled package for ubuntu 10.04 64bits (no 32bits, no other ubuntu version). get it here.

  14. hugogo
    July 14, 2010 at 12:02 pm

    Instale el LemonPos version 0.9.3rc1-1 y MySql Database Server desde el Centro de Software (Ubuntu 10.04 LTS – la versión Lucid Lynx – publicada en abril de 2010). El servicio de MySql está ok, el firewall está deshabilitado y el script de creación de la Base de Datos lemondb fue ejecutado exitosamente. Pero el squeeze no loguea con admin-linux simplemente se queda ‘freezes’ en la autenticación. Que puede estar ocurriendo?

    • July 14, 2010 at 12:45 pm


      Que yo sepa, la ultima version disponible en ubuntu (lucid) es la 0.9.1 . Asi que posiblemente si instalaste el 0.9.3-rc1 es del que esta en sourceforge.

      Checa que este este paquete instalado en ubuntu:


      • hugogo
        July 14, 2010 at 10:22 pm

        Miguel, si está instalado el controlador qt4 para MySql. :S en realidad no sé que pueda ser todo se ve en orden. How can debug the app? Does anybody know the solution?

      • July 15, 2010 at 12:00 pm

        Ve el log de squeeze en la salida estandar (standar output), para ver esta salida necesitas correr squeeze desde la linea de comandos en una terminal, ahi en la terminal estara sacando todos los mensajes de depuracion…. te puede dar alguna pista de que esta pasando.

        Asegurate que en realidad este la base de datos y el usuario en mysql. Conectate a mysql desde la linea de comandos (terminal) :

        mysql -ulemonclient -p

        El password no lo quiero postear aqui, esta en el script de creacion de la base de datos, busca la linea que contenga lo siguiente:
        GRANT ALL ON lemondb.* TO
        al final esta el password entre comillas simples. (despues de IDENTIFIED BY).

        Si logras la conexion, entonces fijate las bases de datos y tablas que hay
        show databases;

        | Database |
        | information_schema |
        | lemondb |

        use lemondb;
        show tables;
        aqui veras 27 tablas, con esto verificaras que existe la base de datos y el usuario para mysql que usara lemon/squeeze.

        Tambien puedes listar los usuarios de lemon:
        select username from users;

        Para salir de mysql escribe exit o presiona CTRL-D.

  15. hugogo
    July 15, 2010 at 10:42 pm

    Efectivamente, me conecto con el usuario lemonclient y clave ‘x********1’ y veo las 17 tablas y 3 vistas. Al iniciar $squeeze, aparece:

    squeeze(2540) KPlotWidget::Private::calcDataRectLimits: y1 and y2 cannot be equal. Setting y2 = y1 + 1.0
    “You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘:maxV) ORDER BY stockqty ASC LIMIT 5’ at line 1 QMYSQL: Unable to execute query”
    Disabling Actions..
    login cancelled…

    • July 15, 2010 at 11:41 pm

      Para empezar, verificame que version instalaste… .deb o .tar.gz , de donde la bajaste.
      Despues, de donde sacaste el scrip de creacion de base de datos? del tar.gz o de lo que instalo el .deb o de otro lado?

      Esto para ver si no hay algun conflicto entre la version del programa y la base de datos que estas usando.

    • July 15, 2010 at 11:55 pm

      Se muestar la pantalla de donde pide usuario y clave?

      Modificaste algo en la configuracion antes?

  16. hugogo
    July 17, 2010 at 12:36 am

    Verdad, habia ejecutado un script 0.8 para la version instalada 0.9.1. Lo que noto ahora es que al agregar usuarios en squeeze se congela la aplicacion.

    • July 17, 2010 at 4:25 pm

      Ese bug esta arreglado en la version 0.9.2 en adelante.

      • November 12, 2010 at 6:01 pm

        Instalamos esa versión pero el problema persiste: se congela al agregar nuevos usuarios.

      • November 13, 2010 at 9:18 am

        Que version instalaste?
        ( instalaste primero una y luego otra mas nueva?, tambien hay que re-hacer la base de datos o “actualizarla”).

  17. hugogo
    July 18, 2010 at 1:51 am

    Muchas Gracias. Luego de ‘cerrar caja’ puedo imprimir un numero de ticket especifico en lemonpos? Y durante el registro de una venta aplicar descuento ocasional para un producto?

    • July 20, 2010 at 11:41 am

      Lo que quieres es volver a iniciar los numeros de tickets cada “turno” de vendedor?

      La respuesta rapida es NO.

      Esto es por la forma en que esta diseñado lemonpos y por la forma que esta creada la base de datos. Lemon pide a la base de datos el numero de ticket siguiente, y no lo asigna el, es por esto que lemon no puede decidir el numero de ticket actual o futuro (con excepcion de reimpresion de tickets o retomando ventas suspendidas en lemonpos 0.9.2+).

      Por otro lado, si quieres forzar a volver a 1 el ticket, tendrias que borrar la tabla (transactions) de la base de datos y volverla a crear. Esto con sus respectivas consecuencias (perder el registro de ventas), que no veo que sea util.

  18. ahmed
    July 22, 2010 at 8:14 pm

    Hello all

    when am trying to add vendor the squeeze stop responding and i have ver 0.9.2 any help plz

    • July 22, 2010 at 9:13 pm

      You could try one thing and see if it works:

      “Keep moving the mouse when adding an user (after editing the fields, when finishing).”

      This is not a lemonPOS bug, its a new bug/change/feature on the linux kernel /dev/random thing, maybe not present on all linux distributions.

      This bug is already fixed on 0.9.3-rc1 .

      – BUGFIX : Squeeze Freezes when adding a new user, under certain conditions. May influence kernel version.
      This bug is related to /dev/random. Now hash function uses /dev/urandom,
      and the mouse need to be moved during the ‘add user’ action.

  19. Chrispin
    August 4, 2010 at 5:28 am

    I did successfully install and create db for lemonpos 0.9.1. What is the default login credentials to start using the system. I’ve tried username = admin Password = linux but not going through.

    Desperate for help


    • August 4, 2010 at 4:37 pm

      What is the debug output from lemon? (running at the terminal).
      Running lemon in the same computer where mysql is installed?
      is libqt4-sql-mysql installed? (this is required to connect to mysql).

  20. Michael
    September 7, 2010 at 6:57 am


    instalé lemonpos_0.9.3rc2-1_i386.deb ubuntu 10.04, funciona todo, pero squeeze no me permite agregar productos


    • September 7, 2010 at 12:25 pm

      creaste la base de datos? es la version correcta del script para crear la base de datos?
      que errores marca en la salida estandar ( cuando se corre squeeze desde una terminal/consola).

  21. Michael
    September 7, 2010 at 3:16 pm

    eliminé la base de datos, habilite las tablas vinculadas (phpmyadmin), cargé el script nuevamente y ya me permite agregar productos, pero ahora no aparecen en lemonpos, busco por codigo y no encuentra el producto

  22. Michael
    September 15, 2010 at 12:41 pm


    quité y reinstalé todo incluso el script y ahora funciona sin problemas


  23. Lawrence McDonald
    September 17, 2010 at 12:56 pm

    Firstly I love this program !

    I still have the hang problem in adding a user .
    I use slackware 13.1 64 , can I use the *.deb binary as is ? Please give me a link to the source for me to build if i cant ,

    Thank you

  1. No trackbacks yet.
Comments are closed.
%d bloggers like this: