Rumah pangkalan data tutorial mysql 用mysql作openldap的后台数据库

用mysql作openldap的后台数据库

Jun 07, 2016 pm 04:16 PM
mysql Belakang pentas pangkalan data

Setting up OpenLDAP with MySQL backend 用mysql作后台数据库安装openldap author: TBONIUS OpenLDAP is an X.500 Lightweight Directory Access Server used for centralized authentication and directory lookups. This article covers configuring this

  Setting up OpenLDAP with MySQL backend

  用mysql作后台数据库安装openldap

  author: TBONIUS

  OpenLDAP is an X.500 Lightweight Directory Access Server used for

  centralized authentication and directory lookups. This article covers configuring this service to utilize SQL services in order to store its data object. Having these objects stored in a SQL database allow for third party applications access to manage these objects.

  openldap是一个基于x.500协议用来集中认证和目录搜索的级目录访问服务器。这篇文章包含的内容是:利用sql服务来配置这个服务器 ,用来保存对象和数据。允许第三方应用访问、管理这些保存在SQL数据库里的对象。

  Ports that are needed:

  需要的ports有:

  MySQL 4.x server : /usr/ports/databases/mysql41-server

  MySQL 4.x client : /usr/ports/databases/mysql41-client

  LibIODBC 3.x : /usr/ports/databases/libiodbc

  MyODBC 3.x : /usr/ports/databases/myodbc

  OpenLDAP 2.x : /usr/ports/databases/openldap21-server WITH_ODBC="YES"

  Configuring the MySQL server

  配置mysql服务器

  OpenLDAP has the option to use many different kinds of databases, in this case we will use MySQL. The first step in setting this up is to create a MySQL database for which OpenLDAP will use.

  openldap可选很多不同种类的数据库。在这种情况下,我将使用mysql。要完成这个任务的第一步是建立一个openldap将要使用的mysql数据库

  root@host # mysqladmin create ldap

  Next we will create a MySQL account that OpenLDAP will use for our newly created ldap database

  下面我将建立一个openldap会用的mysql帐号,对应我们新建立的ldap数据库。

  root@host # mysql

  Welcome to the MySQL monitor. Commands end with ; or g.

  Your MySQL connection id is 10 to server version: 4.0.18

  Type 'help;' or 'h' for help. Type 'c' to clear the buffer.

  mysql>;grant all privileges on ldap.* to 'ldap'@'localhost'

  ->;identified by 'password' with grant option;

  Query OK, 0 rows affected (0.13 sec)

  We of course want to substitute 'password' with the actual password we wish to use for this particular user account

  对特定的用户帐号,我们当然想用我们真正想用的密码替换'password'。

  Configuring LibIODBC to use the MyODBC driver

  配置LibODBC使用MyODBC驱动。

  Quite simply we need to edit two file here to get LibODBC to use the MyODBC driver in accessing the MySQL server.

  事实上我们只需要简单得修改这里的两个文件就可让LibODBC使用MyODBC驱动来访问MySQL服务器。

  Take a look at the /usr/local/etc/libiodbc/odbcinst.ini file and make the following changes

  看看这个文件/usr/local/etc/libiodbc/odbcinst.ini并修改内容:

  [ODBC Drivers]

  MySQL = Installed

  [MySQL]

  Description=ODBC for MySQL

  Driver=/usr/local/lib/libmyodbc3.so

  Take a look at the /usr/local/etc/libiodbc/odbc.ini and make the following changes

  看看这个文件/usr/local/etc/libiodbc/odbc.ini并作如下修改:

  [ODBC Data Sources]

  ldap = MySQL LDAP DSN

  [ldap]

  Driver = /usr/local/lib/libmyodbc3.so

  Description = OpenLDAP Database

  Host = localhost

  ServerType = MySQL

  Port = 3306

  FetchBufferSize = 99

  User = ldap

  Password = password

  Database = ldap

  ReadOnly = no

  Socket = /tmp/mysql.sock

  [ODBC]

  InstallDir=/usr/local/lib

  Again, substitute password for the actual password we created for the ldap user of the MySQL database.

  再次,为我们在mysql数据库建立的ldap用户的密码。

  We can test our current configuration before installing and configuring OpenLDAP. LibIODBC provides a test utility to check DSN configurations.

  在安装配置openldap以前,,我们可以测试我们当前的配置。LibIODBC提供了检测DSN配置的测试工具。

  Note from darxpryte: Upon following this tutorial I've found that iodbctest was not built automatically. This may be fixed later but if you find this to be the case you'll need to do the following:

  darxpryte提示:在这篇指南的下面,我发现iodbctest没有自动建立,以后或许会修正这个问题,不过如果你需要如此的话,按照修面的操作:

  cd /usr/ports/databases/libiodbc/

  make extract

  cd work/libiodbc-3.52.2/samples

  make install

  This will install iodbctest into /usr/local/bin/

  这将把iodbctest安装到/usr/local/bin/

  Once you install iodbctest, you can do the following to test your connection:

  一旦你安装了iodbctest,你就可以安装下面的方法来测试你的连接:

  root@host # iodbctest

  iODBC Demonstration program

  This program shows an interactive SQL processor

  Driver Manager: 03.51.0001.0908

  Enter ODBC connect string (? shows list): ?

  DSN | Description

  ---------------------------------------------------------------

  ldap | MySQL LDAP DSN

  Enter ODBC connect string (? shows list):DSN=ldap

  Driver: 03.51.06

  SQL>;show tables;

  Tables_in_ldap

  ---------------------

  authors_docs

  documents

  institutes

  ldap_attr_mappings

  ldap_entries

  ldap_entry_objclasses

  ldap_oc_mappings

  ldap_referrals

  persons

  phones

  result set 1 returned 10 rows.

  This shows us that the DSN is configured correctly for LibIODBC to use the MyODBC driver in order to connect to our ldap database we set up on our MySQL Server

  这表示,DSN已经为LibIODBC配置好使用MyODBC驱动,好用来连接到我们在mysql服务器上安装的ldap数据库。

  If you have problems displaying the DSN names defined in the odbc.ini file via the test program, try exporting the following shell environmental variable:

  如果你通过测试程序时有问题(显示定义在odbc.ini里面的DSN名字),尝试输入下面的shell环境变量:

  For csh or tcsh:

  对于csh或者tcsh:

  setenv ODBCINI /usr/local/etc/libiodbc/odbc.ini

  For sh or bash:

  对于sh或者bash:

  export ODBCINI=/usr/local/etc/libiodbc/odbc.ini

  Configuring OpenLDAP to use MySQL

  配置openldap使用mysql

  During the build of OpenLDAP, we need to pass the WITH_ODBC="YES" option so that the server build the appropriate SQL configurations

  在编译openldap的时候,我们需要跳过 WITH_ODBC="YES"选项,这样,服务器编译专用的sql配置。

  After the make install process, we will copy over the slapd.conf file that is configured to use a SQL backend. This file is buried under the OpenLDAP ports directory in the following path:

  在安装过程完毕后,我们将复制使用SQL作后台的slapd.conf文件,这个文件在openldap的ports目录的下面的路径中生成:

  work/openldap-2.1.30/servers/slapd/back-sql/rdbms_depend/mysql

  Change to this directory, from the ports directory of OpenLDAP, and copy the configuration file over

  >; cp slapd.conf /usr/local/etc/openldap

  Then we can import the back SQL file from this directory into our running MySQL server database

  root@host # mysql

  root@host # mysql

  Optionally we can import the testdb_data and testdb_metadata files into the database so that we can have example data with which to work

Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn

Alat AI Hot

Undresser.AI Undress

Undresser.AI Undress

Apl berkuasa AI untuk mencipta foto bogel yang realistik

AI Clothes Remover

AI Clothes Remover

Alat AI dalam talian untuk mengeluarkan pakaian daripada foto.

Undress AI Tool

Undress AI Tool

Gambar buka pakaian secara percuma

Clothoff.io

Clothoff.io

Penyingkiran pakaian AI

AI Hentai Generator

AI Hentai Generator

Menjana ai hentai secara percuma.

Artikel Panas

R.E.P.O. Kristal tenaga dijelaskan dan apa yang mereka lakukan (kristal kuning)
3 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Tetapan grafik terbaik
3 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Cara Memperbaiki Audio Jika anda tidak dapat mendengar sesiapa
3 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌

Alat panas

Notepad++7.3.1

Notepad++7.3.1

Editor kod yang mudah digunakan dan percuma

SublimeText3 versi Cina

SublimeText3 versi Cina

Versi Cina, sangat mudah digunakan

Hantar Studio 13.0.1

Hantar Studio 13.0.1

Persekitaran pembangunan bersepadu PHP yang berkuasa

Dreamweaver CS6

Dreamweaver CS6

Alat pembangunan web visual

SublimeText3 versi Mac

SublimeText3 versi Mac

Perisian penyuntingan kod peringkat Tuhan (SublimeText3)

Bagaimana untuk membetulkan ralat mysql_native_password tidak dimuatkan pada MySQL 8.4 Bagaimana untuk membetulkan ralat mysql_native_password tidak dimuatkan pada MySQL 8.4 Dec 09, 2024 am 11:42 AM

Salah satu perubahan utama yang diperkenalkan dalam MySQL 8.4 (keluaran LTS terkini pada 2024) ialah pemalam "Kata Laluan Asli MySQL" tidak lagi didayakan secara lalai. Selanjutnya, MySQL 9.0 mengalih keluar pemalam ini sepenuhnya. Perubahan ini mempengaruhi PHP dan apl lain

Halaman ini kosong selepas PHP disambungkan ke MySQL. Apakah sebab fungsi mati () tidak sah? Halaman ini kosong selepas PHP disambungkan ke MySQL. Apakah sebab fungsi mati () tidak sah? Apr 01, 2025 pm 03:03 PM

Halaman ini kosong selepas PHP menghubungkan ke MySQL, dan sebab mengapa fungsi mati () gagal. Semasa mempelajari hubungan antara pangkalan data PHP dan MySQL, anda sering menemui beberapa perkara yang membingungkan ...

Bagaimana untuk mengintegrasikan perkhidmatan Node.js atau Python dengan cekap di bawah seni bina lampu? Bagaimana untuk mengintegrasikan perkhidmatan Node.js atau Python dengan cekap di bawah seni bina lampu? Apr 01, 2025 pm 02:48 PM

Ramai pemaju laman web menghadapi masalah mengintegrasikan perkhidmatan node.js atau python di bawah seni bina lampu: lampu sedia ada (Linux Apache MySQL PHP) Laman web seni bina memerlukan ...

Bagaimana cara berkongsi halaman yang sama di PC dan sisi mudah alih dan mengendalikan masalah cache? Bagaimana cara berkongsi halaman yang sama di PC dan sisi mudah alih dan mengendalikan masalah cache? Apr 01, 2025 pm 01:57 PM

Bagaimana cara berkongsi halaman yang sama di PC dan sisi mudah alih dan mengendalikan masalah cache? Di persekitaran PHP MySQL Nginx yang dibina menggunakan latar belakang Baota, bagaimana menjadikan sisi PC dan ...

Pengunci optimis PHP digabungkan dengan baki potongan urus niaga gagal: Bagaimana untuk memastikan bahawa baki itu ditolak dengan betul dalam situasi konkurensi? Pengunci optimis PHP digabungkan dengan baki potongan urus niaga gagal: Bagaimana untuk memastikan bahawa baki itu ditolak dengan betul dalam situasi konkurensi? Mar 31, 2025 pm 11:42 PM

Penjelasan terperinci mengenai masalah menolak baki dalam kombinasi dengan kunci dan urus niaga optimistik PHP dalam artikel ini akan menganalisis secara terperinci potongan baki menggunakan PHP, kunci optimis dan urus niaga pangkalan data, hanya ...

Memantau Titisan Redis Menggunakan Perkhidmatan Pengeksport Redis Memantau Titisan Redis Menggunakan Perkhidmatan Pengeksport Redis Jan 06, 2025 am 10:19 AM

Pemantauan berkesan pangkalan data Redis adalah penting untuk mengekalkan prestasi optimum, mengenal pasti kemungkinan kesesakan, dan memastikan kebolehpercayaan sistem secara keseluruhan. Perkhidmatan Pengeksport Redis ialah utiliti teguh yang direka untuk memantau pangkalan data Redis menggunakan Prometheus. Tutorial ini akan membimbing anda melalui persediaan dan konfigurasi lengkap Perkhidmatan Pengeksport Redis, memastikan anda mewujudkan penyelesaian pemantauan dengan lancar. Dengan mengikuti tutorial ini, anda akan mencapai persediaan pemantauan yang beroperasi sepenuhnya untuk memantau metrik prestasi pangkalan data Redis anda dengan berkesan.

Adakah debian rentetan serasi dengan pelbagai pelayar Adakah debian rentetan serasi dengan pelbagai pelayar Apr 02, 2025 am 08:30 AM

"Debianstrings" bukan istilah standard, dan makna khususnya masih belum jelas. Artikel ini tidak dapat mengulas secara langsung mengenai keserasian penyemak imbasnya. Walau bagaimanapun, jika "debianstrings" merujuk kepada aplikasi web yang dijalankan pada sistem Debian, keserasian penyemak imbasnya bergantung kepada seni bina teknikal aplikasi itu sendiri. Sebilangan besar aplikasi web moden komited untuk keserasian penyemak imbas. Ini bergantung kepada standard web berikut dan menggunakan teknologi front-end yang serasi (seperti HTML, CSS, JavaScript) dan teknologi back-end (seperti PHP, Python, Node.js, dll.). Untuk memastikan bahawa aplikasi itu serasi dengan pelbagai pelayar, pemaju sering perlu menjalankan ujian silang dan menggunakan responsif

See all articles